Conditionals & looping (contd..)
- foreach Method(): Refer Here
- for loop:
$servers = @('google.com', 'facebook.com', 'linkedin.com', 'asdklfjasdkl')
for($index=0; $index -lt $servers.Length; $index++) {
echo $servers[$index]
}
- while loop:
- do/while & do until:
- do while will be executed as long as your condition is true
- do unitil is inverse of it
- For Example Refer Here
For Creating Windows Server on AWS Cloud
ERROR Handling
- try catch & finally
How to work with many powershell cmdlets
- Start using Cheatsheets. Here is reference to one of many cheats
Next Steps:
- Understand Powershell Modules
- Understand Thirdparty Powershell Modules
- Functions
- Cmdlets
- Writing a full powershell script which is interactive or silent
./InstallWebServer.ps1
Installing IIS8 on your Server. Do you want to Continue? (Y/N)
./InstallWebServer.ps1 -Silent
