#PSTip Capture console screen
Note: This tip requires PowerShell 2.0 or above. PowerShell has many logging capabilities but sometimes what you want is to capture what’s already written to the console.
Read MoreNote: This tip requires PowerShell 2.0 or above. PowerShell has many logging capabilities but sometimes what you want is to capture what’s already written to the console.
Read MoreNote: This tip requires PowerShell 2.0 or above. $host automatic variable contains the details of the PowerShell host. For example, information such as the name of the host, UI culture information, etc.
Read MoreNote: This tip requires PowerShell 2.0 or above. Every PowerShell host implements the $pid automatic variable which refers to the process ID of the PowerShell host process.
Read MoreWe’ll use the [adsisearcher] type accelerator. The [adsisearcher] type is just a shortcut to the System.DirectoryServices.DirectorySearcher .NET class. PS> [adsisearcher].FullName System.
Read MoreNote: This tip requires PowerShell 3.0 or above. The Get-Content cmdlet returns the contents of a file as an array of strings delimited by a newline character.
Read MoreThe -replace operator takes a regular expression (regex) replacement rule as input and replaces every match with the replacement string. The operator itself is used as shown in the following schema: <input string> -replace <replacement …
Read More