Category: Powershell

PowerShell Add-Content

PowerShell Script Files – Add-Content Cmdlet Few built-in cmdlets express their purpose as clearly as Add-Content.  In fact the only danger with this command is ‘over-think’, just remember that PowerShell takes care of opening and closing files automatically.  Consequently, there is no need to waste time looking for non-existent file-open, …

Windows PowerShell Array String

PowerShell Array @("value1", "value2") Arrays strings are designed to store text data.  On this page I want exploit this capability by examining the use of $Variables with PowerShell’s parameters. Store Computer Names in an Array Array For a Parameter With Multiple Values The Array in a PowerShell Loop The Array’s …

PowerShell ConvertFrom-CSV

PowerShell ConvertFrom-CSV The purpose of this page is two-fold, to give working examples of ConvertFrom-CSV and to revive interest in the operating system’s built-in ‘WhoAmI’ command. Topics for PowerShell’s ConvertFrom-CSV Introduction to ConvertFrom-CSV Example 1: Simple ConvertFrom-Csv Example 2: To Display the Groups Unearthed by WhoAmI Example 3: Display User …

PowerShell 3.0 Logon Script

Creating PowerShell v 3.0 Logon Scripts I love logon scripts.  It saddens me that Group Policies are replacing logon scripts as a method of providing access to ‘Shares’ and network printers.  My point: while I am delighted to help you with PowerShell 3.0 logon scripts, really, you should at least …

Windows PowerShell Select-Object

Examples of Windows PowerShell Select-Object PowerShell’s Select-Object is ideal for filtering properties before you output them to file, printer or even read them on-screen.  Perhaps the underlying command produces too much information, with Select-Object you can reduce the number of columns passed to the next element, Format-Table or Out-File. Topics …

PowerShell Enable-NetAdapter

How to Enable a Network Adapter with PowerShell 3.0 With PowerShell 3.0 it’s straightforward to enable a NIC (Network Interface Card), just use a built-in CIM cmdlet called Enable-NetAdapter. Tutorial to Enable (or Disable) a NIC Scenarios for Enabling a Network Adapter How to Enable a Named Network Card How …

PowerShell and Get-QADComputer

PowerShell and Get-QADComputer The Get-QADComputer cmdlet has some unexpected parameters.  For example, you can check which operating system, and which service pack is installed on each of your servers.  If you have not used the QAD cmdlets before, it may be best to start with QADUser. Topics for PowerShell’s Get-QADComputer …

PowerShell Function Get-IPConfig

How to Display MAC or IP Address with Get-IPConfig I designed this cmdlet style function to display IPv4, IPv6 or MAC addresses.  At the heart of this example is the built-in Windows command: IPConfig. Guy's Get-IPConfig Function Planning the Get-IPConfig Function Example: PowerShell Function Get-IPConfig Learning Points for Creating a …