- Aug
- 2,799
- 144
When trying the example from the help file for PSHELL
...does not return the path and name of my PowerShell Profile.
type $Profile works as should in PowerShell 5.1
Joe
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