What is $null in PowerShell?

JesseThick
JesseThick

Posted On: Feb 22, 2018

 

The $null is a variable in the PowerShell that is used to represent NULL as the name suggests. It can be assigned to a variable, use it for comparisons, etc. In PowerShell, $null is an object that holds the value of NULL. To assign $null, use the following command

PS> $null –eq $variable

Here, the $variable holds the value of $null.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    PowerShell Interview Questions

    What is PowerShell?

    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...

    PowerShell Interview Questions

    How to run a PowerShell script?

    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...

    PowerShell Interview Questions

    How to check powershell version in Windows?

    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....