Powershell | Case Switch | DO While loop

Published: 01 January 2021
on channel: InfraFort
264
4

Lets keep the channel going ! Please subscribe if this was helpful :)

#Code for first example;
$a = $null;
do{
write-host "Pick from the following options";
write-host "option 1 - ABC";
write-host "option 2 - DEF";
write-host "option 3 - GHI";
write-host "option 4 - JKL";
Write-Host "option 5 - exit";
$input = Read-Host;

switch($input){
1
{
write-host "*************************";
write-host "One";
Get-Process -Name 'chrome'
}
2
{
write-host "*************************";
write-host "Write process name";
$ProcessName = Read-Host;
Get-Process -Name $ProcessName;
}
3
{
write-host "*************************";
write-host "Three";
}
4
{
write-host "*************************";
write-host "Four";
}
5
{
write-host "*************************";
write-host "quitting...";
$a = 9999;
}
}
}while ($a -ne 9999);


On this page of the site you can watch the video online Powershell | Case Switch | DO While loop with a duration of hours minute second in good quality, which was uploaded by the user InfraFort 01 January 2021, share the link with friends and acquaintances, this video has already been watched 264 times on youtube and it was liked by 4 viewers. Enjoy your viewing!