to run PowerShell script (.ps1), either:
./cleantemp.ps1
or,
.\cleantemp.ps1
works!
Showing posts with label ps1. Show all posts
Showing posts with label ps1. Show all posts
Monday, January 19, 2009
whether AllSigned or Restricted, let PS1 go
to execute PowerShell script (.ps1) w/o initilizing each code signing
step 1) REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="Unrestricted"
By default, the above parameter is not initialised during first time installation. This parameter will remain in the system registry until you remove it manually.
step 2) open powershell object-based function
PS> .\stopit.ps1
step 1) REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell]
"ExecutionPolicy"="Unrestricted"
By default, the above parameter is not initialised during first time installation. This parameter will remain in the system registry until you remove it manually.
step 2) open powershell object-based function
PS> .\stopit.ps1
Labels:
code signing,
function,
object-based,
PowerShell,
ps1,
regedit,
registry,
set-executionpolicy
Subscribe to:
Posts (Atom)