Reputation: 151
I am trying to run powershell script version 5.1 in windows 2012R2
powershell.exe -NoProfile D:\test2.ps1 on the powershell command console (I do not the script session using any profile on the system)
$profile
I get output C:\Users\XXXXX\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Any thought why any profile start up in my session.
Upvotes: 0
Views: 2471
Reputation: 21408
The profile isn't loading, because you specified -NoProfile
on powershell.exe
. However, the $profile
variable is still defined.
Upvotes: 2