PowerShell Error Handling - One error at the time please

Code fails - whether because of reasons out of our control, or because we didn’t consider the situation it might fail. Expired credentials, timeout connections, lack of permissions go genuine software bug - each of these are potential problem which might fall our code over. And if we don’t handle the error, our script will simply throw and terminate. It’s certainly not desired state. In this video I’ll show you different ways PowerShell can error, how to debug such errors and how to handle them - so that we are in control....

21 January 2023 · 1 min · 93 words · Kamil

PowerShell for IT Professionals [#3] – Running Commands

Exercises Display a list of all services that start with the letter W Display all processes (you might need to use Help to discover the right command. Remember the noun might be singular). Open Notepad (you can simply punch in notepad in the shell) Display only processes that have a name “Notepad” Once you can there’s only one instance of Notepad running, close it with PowerShell! (Verb would be Stop) Confirm with Shell there are no more Notepad processes running Display last 10 lines of C:\windows\setupact....

27 July 2020 · 2 min · 257 words · Kamil