Difference between revisions of "Getting Started (PowerShell)"

Jump to navigation Jump to search
m (→‎Process Priority: Added scheduled tasks priority note)
(→‎Execution Policy: Added expected error messages)
Line 18: Line 18:


== Execution Policy ==
== Execution Policy ==
On the first run you need to allow Powershell to scripts (you need to run this command as an administrator, so if you're using Windows 7, for example, you'll need to start the Powershell console as an administrator, regardless of whether you're currently logged in as an admin).  If you have no admin rights over the PC you're using, then you'll need to select the Suspend option rather than Yes (sets just for your current session, doesn't try to write to the registry).
On the first run you need to allow Powershell to scripts to execute, otherwise you'll get an error that contains the following when trying to run a script...
* <code> cannot be loaded because the execution of scripts is disabled on this system.</code>
 
'''You need to run the command below as an administrator''', otherwise you'll get an error like...
* <code> Set-ExecutionPolicy : Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is denied. </code>
 
So if you're using Windows 7, for example, you'll need to start the Powershell console as an administrator (right-click ''Run as administrator''), regardless of whether you're currently logged in as an admin).  If you have no admin rights over the PC you're using, then you'll need to select the Suspend option rather than Yes (sets just for your current session, doesn't try to write to the registry).
<source lang="powershell"> Set-ExecutionPolicy RemoteSigned </source>
<source lang="powershell"> Set-ExecutionPolicy RemoteSigned </source>
It is possible to bypass the Execution Policy entirely (though you do so at your own risk, should only be used to run a script you trust where you haven't the time to fix the underlying problem, and should be reverted afterwards)...
It is possible to bypass the Execution Policy entirely (though you do so at your own risk, should only be used to run a script you trust where you haven't the time to fix the underlying problem, and should be reverted afterwards)...