Category: Powershell

Windows PowerShell Select

Introduction to Windows PowerShell Select These are three way that PowerShell uses ‘Select’: Perhaps the most common way is in a WMI Query Language (WQL) statement.  For example, Get-WmiObject uses ‘-query’ to introduce a classic ‘Select * from’ a phrase, see example 1 The second context for ‘Select’ in PowerShell …

PowerShell Array String Conversion

How PowerShell Converts an Array into a String The problem is getting the formatting right when you convert chunks of data into a single string.  The solution is an operator called -Join. PowerShell String Problem Solution to Array String Problem Controlling PowerShell Arrays with the $OFS Variable PowerShell Array Introduction …

PowerShell Limit-Eventlog

PowerShell Limit-Eventlog Cmdlet This cmdlet could represent a watershed for using PowerShell to manage computer tasks.  Either you could configure the event logs options with the traditional Event Viewer GUI, or better still, you could master PowerShell's Limit-Eventlog. PowerShell Limit-Eventlog Topics Refresher with Get-Eventlog Limit-Eventlog Increases Logsize Tactics for Event …

PowerShell Get-Help Cmdlet

PowerShell Get-Help Cmdlet My goal on this page is to explain Get-Help’s hidden but useful nuances. The examples are designed to help intermediate scripters delve deeper into PowerShell’s capabilities.  Windows PowerShell Get-Help Topics Structure of PowerShell’s Get-Help Learning About Get-Help’s Syntax PowerShell Version Check Five Attributes of a Parameter  ♣ …

PowerShell Export-CliXml Cmdlet

PowerShell Export as XML Don’t use Export-CliXml, use ConvertTo-Html instead! Question: OK; what is the point of Export-CliXml? Answer: To store objects until you need them again; in which case, you call for the sister cmdlet: Import-CliXml. PowerShell Import and Export-CliXml Topics Export-CliXml Example Export-CliXml – Test with Import-CliXml Learning …

PowerShell – Get-Item

Windows PowerShell – Get-Item Cmdlet PowerShell’s Get-ChildItem has a little sister called Get-Item. Topics – Examples of Get-Item Real Life Example: List Environmental Variables Research Get-Item’s Parameters Find the Alias of Get-Item Summary – PowerShell Script to Delete Files  ♣ Real Life Example: List Environmental Variables Our mission here is …

Windows PowerShell Brackets

Introduction to Windows PowerShell – Type of Bracket Did you ever buy a light bulb with a bayonet socket, only to discover that you really needed a bulb with a screw fitting?  Well, PowerShell brackets require similar attention to detail otherwise your script will also remain in the dark. Windows …

PowerShell Write-Eventlog

PowerShell Write-Eventlog Cmdlet PowerShell's Write-Eventlog is one of the most difficult cmdlets to master.  The problem is that we are asking a script to mimic how the operating system or an application writes to eventlog.  For that to be successful we need to understand valid source and EventIDs.  PowerShell Write-Eventlog …