Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

PSHELL: Cannot bind argument to parameter 'Path' because it is null.

Aug
2,799
144
When trying the example from the help file for PSHELL

SHELL supports multiple string or filename arguments. If a string or filename has embedded whitespace, you must enclose it with double quotes. For example:

pshell /s "type $Profile"

Without the double quotes PSHELL would interpret this as two commands.

Code:
R:\>whatver
     _x64: 1
   _admin: 1
_elevated: 1

TCC  36.00.16 x64   Windows 10 [Version 10.0.19045.7058]
BuildNumber  Caption                   CSDVersion  OSArchitecture  Version
19045        Microsoft Windows 10 Pro              64-bit          10.0.19045

22H2

R:\>pshell /s "type $Profile"
PSHELL: Cannot bind argument to parameter 'Path' because it is null.

Code:
R:\>pshell /s "$Profile"

...does not return the path and name of my PowerShell Profile.

type $Profile works as should in PowerShell 5.1

Joe
 
When trying the example from the help file for PSHELL

R:\>pshell /s "type $Profile"
PSHELL: Cannot bind argument to parameter 'Path' because it is null.[/code]

Joe

That doesn't work in v35 either, because the (former) Powershell bridge is broken in newer versions of Windows / Powershell. (Though in v35 it simply doesn't do or display anything at all.)
 
Not reproducible here:

Code:
[D:\TakeCommand36\TCExplorer]pshell /s $profile
C:\Users\Rex Conn\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
That one doesn't work here.
 
Code:
E:\Utils>ver

TCC  36.00.16 x64   Windows 10 [Version 10.0.19045.7058]

E:\Utils>pshell /s "$PSVersionTable.PSVersion"
5.1.19041.7058

E:\Utils>powershell.exe -nologo -command $Profile
C:\Users\jlcav\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

Joe
 
Works in Build 19.

Code:
R:\>ver

TCC  36.00.19 x64   Windows 10 [Version 10.0.19045.7058]

R:\>pshell /s "type $Profile"
 
Back
Top