PowerShell for IT Professionals [#5] – Providers

Exercises Create a folder in root of C: with the name of PowerShell Create a file inside the folder with the name of your choice and no content Retrieve all items from Env: drive Check the version of Notepad.exe in Windows directory Discover current Windows build version by registry property: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion Notes from the lesson # Provider allows to access some data storage (e.g. File system, registry, remote system, Active Directory) # This concept might sound a bit abstract at first, but becomes very straight forward once you've used it for a while # Provider once connected to the data storage, kind of "mounts" it like a network drive, allowing to browse and manage it # Once the storage is mounted PowerShell creates so called PSDrive # Let's review available providers Get-Psprovider # Let's review some PSDrives Get-PSDrive # A quick refresher how file system is organised: Drives, Folders, Files # Since PowerShell connects to many different file data storages, it uses the generic term Item and specifies with type....

4 August 2020 · 2 min · 418 words · Kamil

PowerShell for IT Professionals [#4] – Pipeline

Exercises There’s one particular command that allows you output anything from shell to file, find that command and use with any commands like Get-Service or Get-Process. Does it behave differently than Export-CSV? Programs often use CSV but don’t use comma for delimiter – try to exporting to CSV but change the delimiter Can you print directly from shell? See if there are any commands available and if so, print some Event Logs!...

30 July 2020 · 2 min · 259 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

PowerShell for IT Professionals [#1] [#2] – Help

About files solve issue If after running Update-Help you don’t have About topics, you might want to manually download them and extract the archive to the root of: C:\Windows\System32\WindowsPowerShell\v1.0\en PowerShell help – Exercises PowerShell is great in working with CSV files. Can you find help for any CSV related commands (you will need to use a wildcard) Can you tell what’s a difference between ConvertTo-CSV and Export-CSV commands We often need to review event logs – which command would allow you to retrieve event logs?...

23 July 2020 · 1 min · 147 words · Kamil

Deploying software with GPO

Having software consistently deployed across the fleet of computers is one of the key points that can be automated. If I have a choice (and it makes sense), I will always choose GPO over any other solution because it’s embedded into Active Directory thus not requiring installation, learning and maintenance of additional management tool. MSI – Software Installation One of the main advantages of MSI installers is that in 99% of cases you can just use the “Software Installation” option in GPO, and GPO will take care of the silent installation....

15 March 2020 · 5 min · 898 words · Kamil