PowerShell is a powerful scripting language and shell framework developed by Microsoft. It’s an essential tool for system administrators and IT professionals, but why is it so important? Let’s dive in.
[Read more…] about Intro to PowerShell: What makes it essential for IT pros?PowerShell replacement for ‘chkdsk’
Fix your disk using the PowerShell successor to chkdsk, Repair-Volume.
Fixing a corrupted file system, the old way
At some point in your IT career, you’ve likely encountered a few bad sectors on a hard drive. The impact can be anything from stuttering performance to a non-starting computer.
Since 1981, chkdsk has been the go-to built-in Microsoft utility for scanning and fixing the disk. By “fixing” I don’t mean it can physically repair the disk itself, but checking the file system integrity and fix any logical file system errors.
While chkdsk is still available in Windows today, a successor PowerShell cmdlet was introduced in Windows Server 2012, Repair-Volume.
[Read more…] about PowerShell replacement for ‘chkdsk’Using the Windows PowerShell Compatibility Module in PowerShell Core
Access and use Windows PowerShell cmdlets from your PowerShell Core session on a Windows computer.
Missing cmdlets from PowerShell Core
In the last post, we installed PowerShell Core on a Windows computer. However, if you were to try using some common Windows PowerShell cmdlets from the session or via script, such as Get-WmiObject, you would get an error (below) because Get-WmiObject is a Windows PowerShell cmdlet and not part of PowerShell Core.
PS C:\Users\Demo> Get-WmiObject -Class Win32_ComputerSystem Get-WmiObject : The term 'Get-WmiObject' is not recognized as the name of a cmdlet, function, script file, or operable program. At line:1 char:1 + Get-WmiObject -Class Win32_ComputerSystem + ~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-WmiObject:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Install Windows PowerShell Compatibility Module
Recognizing that in order to get Windows users to start installing and using PowerShell Core it had to be on par with Windows PowerShell, Microsoft released the Windows PowerShell Compatibility Module. This module makes Windows PowerShell cmdlets available from a PowerShell Core session.
[Read more…] about Using the Windows PowerShell Compatibility Module in PowerShell CoreInstall PowerShell Core on Windows
Install manually via MSI or with the Chocolatey package manager.
Installing PowerShell Core using MSI
The primary way for installing PowerShell Core is to download the official MSI release from the PowerShell GitHub page. Scroll down to Get PowerShell and click the .msi link from the Downloads (stable) column for your version of Windows (either x86 or x64).
[Read more…] about Install PowerShell Core on WindowsDecision to Switch to PowerShell Core (pwsh)
The decision is clear: it is time to switch to PowerShell Core.
A lot has happened since the last time I published a post (November 2017), including the release of PowerShell Core 6.0 in January 2018.
[Read more…] about Decision to Switch to PowerShell Core (pwsh)