Category: Powershell

Top 10 PowerShell Aliases

Top 10 PowerShell Aliases for DOS Commands. I have discovered two types of Alias aficionados.  Firstly, there are those who like to use aliases such ‘dir’, ‘cd’ or ‘cls’ in PowerShell, because they used the same commands in DOS.  Secondly, there are those who embrace PowerShell aliases such as ‘sort’, …

PowerShell Get-Content

PowerShell Script Files: Get-Content Cmdlet The ability to ‘Get-Content’ is useful for itself; moreover, this cmdlet illustrates how easily PowerShell deals with reading from text files.  Incidentally, this page also demonstrates looping, which is a classic job for automation via scripting, and a task that PowerShell delivers with deceptive ease. …

PowerShell Disable-NetAdapter

PowerShell v 3.0 Disable Network Adapter PowerShell version 3 makes it easier than ever to control your NIC (Network Interface Card) with Enable and Disable-NetAdapter cmdlets. Tutorial for Disable-NetAdapter Scenarios for PowerShell’s Disable-NetAdapter How to Disable One of Your Network Cards Enable Your Disabled Network Card Troubleshooting Disable-NetAdapter Research The …

PowerShell Invoke-Item Cmdlet

Introduction to Invoke-Item My main use for Invoke-Item is when my PowerShell script has just created a file, and I am itching to view its formatted contents.  Another use is running executables. Topics for the Invoke-Item Cmdlet Compare Invoke-Item with Get-Content Invoke-Item with Executables Creating, Then Viewing a Html File …

PowerShell Examples – Get-Service

PowerShell Examples Featuring Get-Service This page of PowerShell examples concentrates on Windows services.  While ‘Get’ is PowerShell’s default verb, this page alerts you to additional verbs such as stop, start and restart. Topics for PowerShell Service Examples Finding Files Example 1:  Get-Service – The Basics Example 2:  More Verbs For …

PowerShell WMI Techniques

Introduction to PowerShell’s WMI Techniques One of the most useful jobs for PowerShell is to create a bank of WMI based scripts.  Furthermore, scripting WMI with PowerShell is much easier and more efficient than WMI with VBScript. Topics for PowerShell WMI Techniques Get-WmiObject WmiObject Get-Member WmiObject – Help with Parameters …

Windows PowerShell Restart-Computer

PowerShell Restart-Computer PowerShell v2.0 introduces the Restart-Computer cmdlet, which is very similar to the operating system’s built-in shutdown /r command.  A likely scenario is that you wish to automate the reboot of a local or remote server. Topics for PowerShell Restart-Computer Introduction to Restart-Computer Restart-Computer and Stop-Computer Simple Example of …

Microsoft’s PowerShell and SQL

Introduction to PowerShell with SQL Don’t Do It! A Reminder of PowerShell’s Strengths How PowerShell Interacts with SQL Sample PowerShell Cmdlets for SQL  ♣ Don’t Do It! My advice for beginners is: ‘Avoid PowerShell and SQL!’  My thinking is use SQL’s own tools to extract and present the data.  PowerShell …