Posted On: Feb 22, 2018
$_ in the PowerShell is the ‘THIS’ toke. It refers to the current item in the pipeline. It can be considered as the alias for the automatic variable $PSItem.
//example
PS> 1, 2 | ForEach-Object {Write-Host $-}
The above code prints 1 2. It represents the current value and prints it.
Never Miss an Articles from us.
PowerShell is a command-line tool built upon the .NET framework to help the windows system administrator. With PowerShell, you can control your system operations such as accessing data storage, regist...
To run a script in the PowerShell, go to the directory where your script is stored on your PowerShell command. Then, run the script by typing the following command. PS C:\script_folder> ./Script.p...
Open your PowerShell command and type the following command to find the version, PS C:\> $PSVersionTable.PSVersion The major column value of the result is the version of your PowerShell....