first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

PowerShell 1.x and CMD: Running a PowerShell Session with a Different Execution Policy

@ECHO OFF REM This command runs PowerShell REM with a different execution policy REM than the default Restricted mode REM and restores the default mode upon exit. ECHO This command will start PowerShell in RemoteSigned mode. ECHO Are you sure you want to continue? (Press Ctrl C to quit.) PAUSE @CLS powershell -NoExit -Command "& {Set-ExecutionPolicy RemoteSigned}" ECHO Stopping PowerShell in Restricted mode... powershell -Command "& {Set-ExecutionPolicy Restricted}" ECHO Verifying policy status... powershell -Command "& {Get-ExecutionPolicy}"

REM For a more formal approach, see “Signing PowerShell Scripts” here: REM http://www.hanselman.com/blog/SigningPowerShellScripts.aspx

mod date: 2007-08-28T21:50:00.000Z