My PowerShell Notes

I plan to collect here all my notes related to PowerShell. Currently, they are scattered in various places, but I intend to consolidate them, and put some structure to them. For the most part, I just provide code for routine tasks, or for challenging problems. I use that code for copy & paste, and also to get some ideas. I do not plan to provide explanations, and instead please refer to existing books and articles for a deeper understanding.1

The notes have been accumulated over a long period; hence, some information is outdated and does not work any more; for some other tasks, there are currently better approaches. Of course, there are also mistakes, so do check before you apply. Let me know of any mistakes, or if you have any suggestion using the gitbook website:

https://www.gitbook.com/book/gkantsidis/powershell-notes/changes

To compile this set of notes, I have used many resources, including books, articles, and, most frequently, online posts. Unfortunately, I have been lazy in keeping track the sources I used, and I cannot give proper credit to the original posters. Apologies for that. If you spot your code somewhere, let me know and I will acknowledge you.

Even though it is possible to download this set of notes as a PDF and other book formats, keep in mind that there are code listings that are long. They appear better on a browser on a desktop machine. Most likely, the best use of them is to read the code and copy&paste.

Environment Setup

I am using a highly customized environment. I have tried to provide a number of useful commands and module, and make my PowerShell shell a bit more excited and useful. The code for it is in GitHub [https://github.com/gkantsidis/WindowsPowerShell]. To use it just clone it under %HOME%\Documents\WindowsPowerShell; see also the instructions on the GitHub page.

A few things to keep in mind, if you plan to use it:

  • Upon shell initialization, the scripts check for updated versions of the various modules, and load some of them. This adds startup latency; typically, it will take around 10sec to start a new shell.
  • I have used the scripts in a few environments (Windows 10, Windows Server 2016, personal and domain-joined machines), but obviously cannot test in every possible configuration. If you experience any problem, let me know by posting on the Issues of the GitHub page. I guess that some of the scripts will not work properly on older installation, as I am using some of the new PowerShell features.

Some other resources

There are plenty of online resources related to PowerShell.

1. I will provide relevant links, but as many of them are online articles, I cannot guarantee that they still exist.

results matching ""

    No results matching ""