Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 2
Next »
Enable the script to run |
|
---|
| link |
| Set-ExecutionPolicy Unrestricted
PS C:\windows\system32> Get-ExecutionPolicy
Restricted
PS C:\windows\system32> Set-ExecutionPolicy Unrestricted
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): yes
PS C:\windows\system32> Get-ExecutionPolicy
Unrestricted
PS C:\windows\system32>
|
Hello World |
|
---|
create | create a .ps1 file >>>> write-host "hello world"
|
use ISE | |
run | > "hello world.ps1" or >& '.\hello world.ps1' |
Print out |
|
---|
| write-host "Welcome to my script" |
|
|
Loop for | Link |
---|
|
|
Loop while |
|
---|
| write-host "Welcome to my script" while ($true){ #test-connection 172.16.128.2 ping 172.26.128.2 -n 1 -l 1472 Start-Sleep -Seconds 6 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|