Welcome!

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

SignUp Now!

Fixed Displaying Profiles from TCC vs. PowerShell

Aug
1,821
59
I have the following, psProfiles.ps1;
Code:
$PROFILE
test-path $PROFILE

$PROFILE.CurrentUserCurrentHost
test-path $PROFILE.CurrentUserCurrentHost

$PROFILE.AllUsersAllHosts
test-path $PROFILE.AllUsersAllHosts

$PROFILE.AllUsersCurrentHost
test-path $PROFILE.AllUsersCurrentHost

$PROFILE.CurrentUserAllHosts
test-path $PROFILE.CurrentUserAllHosts

When I run it from PowerShell;
Code:
PS C:\utils> .\psprofiles.ps1
C:\Users\jlc\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
True
C:\Users\jlc\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
True
C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
False
C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
False
C:\Users\jlc\Documents\WindowsPowerShell\profile.ps1
False

When I run it from TCC using PSHELL;
Code:
c:\users\jlc\utils>pshell psProfiles.ps1
PSHELL: System.Management.Automation.ParameterBindingValidationException : Cannot bind argument to parameter 'Path' because it is null.

Why the difference?

Joe
 

Similar threads

Back
Top