PowerShell for IT Professionals [#15] – Scripting part 2 – IF and psobject

In this lesson we carry on writing the scripting by gathering requirements and putting them together as comments in code. Then we will retrieve OS information with the help of WMI and display it on the screen with Write-Host. Although using Write-Host is easy to use, it doesn’t really allow us to do very much e.g. we cannot export information to the CSV, therefore we change it and start using custom PSObject – that way our script will start returning information like a regular PowerShell command....

5 October 2020 · 1 min · 206 words · Kamil

PowerShell for IT Professionals [#14] – Scripting – Hello World!

In this lesson we will be preparing our workstation for writing PowerShell scripts. We will start by enabling RSAT and then install Visual Studio Code which is a recommended and free PowerShell code editor. We will then have a look at the basic function of VS Code and create a simple “Hello World” script. Exercises If you haven’t followed along, you definitely would like to install VS Code and create a *....

26 September 2020 · 1 min · 98 words · Kamil

PowerShell for IT Professionals [#13] – Is PowerShell secure?

In this lesson we will have a look on PowerShell built in security features and how it differs from e.g. BAT files. We will then have a look how execution policy can help to control on what basis the PowerShell scripts can be executed. At the end, we will configure some GPOs to control the execution and transcription of scripts.

12 September 2020 · 1 min · 60 words · Kamil

PowerShell for IT Professionals [#12] – WMI – Windows Management Instrumentation

In this lesson we learn how to use PowerShell to access WMI (Windows Management Instrumentation), so that we can gain often hidden or obscure information. We will then use WMI Explorer graphical tool to ease discovering all possible classes and instances that WMI provides. Finally, we will use WMI queries to add another level of granularity in GPO so that we can target very specific computers in it. Exercises There’s a WMI class that lists all the installed software – find it and list all currently installed software with PowerShell....

5 September 2020 · 2 min · 311 words · Kamil

PowerShell for IT Professionals [#11] – Variables

In this lesson we’re going to learn how what Variables are, why it’s good to use them and how to actually create them. We will then assign various values to variables to and use them solely, and in parameters. We will also have a look at foreach loop so that we can e.g. ping multiple computers using single variable with multiple objects in it. Exercises Use Get-Command to find all commands that allow you to manage variables....

29 August 2020 · 2 min · 371 words · Kamil