1. Aaron Jensen
  2. Carbon
  3. Issues
Issue #134 resolved

Import Carbon fails with PATH environment variable that has includes another drive.

Anonymous created an issue

This portion of the carbon.psm1 fails when importing:

There is a mapped G: drive,

and there exists a user environmental variable PATH = G:\bat

I don't see this error when I run the line from the ISE, only from Console.

$useServerManager = ($env:Path -split ';' | Where-Object { $_ } | ForEach-Object { Join-Path -Path $_ -ChildPath 'servermanagercmd.exe' } | Where-Object { Test-Path -Path $_ -PathType Leaf }) -ne $null

Join-Path : Cannot find drive. A drive with the name 'G' does not exist. At line:1 char:84 + ... rEach-Object { Join-Path -Path $_ -ChildPath 'servermanagercmd.exe' } | Where-Ob ... + ~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (G:String) [Join-Path], DriveNotFoundException + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.JoinPathCommand

Comments (2)

  1. Log in to comment