We have discussed setting the values to the variables in PowerShell, in our previous article. Through this article, we will discuss resetting the values; means, clear the content of the variables. PowerShell provides a command to reset the variables. This is very helpful; especially when we have to manage a long script where it is […]
PowerShell – Does it possible to delete variables?
Yes, it is possible to remove the variables defined in PowerShell. PowerShell provides a command Remove-Variable to delete the variables defined in the current scope. The Remove-Variable cmdlet You need to pass the variable name through “-Name” parameter to delete the variables. PS C:\> Remove-Variable var If the variable is exists, it removes the variable. […]
PowerShell – How to set variables?
Once we define the variables, we can alter the content of the variables anytime. Through this Article, we are going to discuss different ways to set the content of the variables. Setting Variables in PowerShell We can assign the values to the variables when we define them. We can also change the values whenever needed. […]
PowerShell – How to create read-only and constant Variables?
PowerShell supports constant and read-only variables. We have discussed creating the variables in our previous Article “PowerShell – How to create Variables?“. Through this, we are going to discuss creating read-only and constant variables. Read-only variables are the variables whose content cannot be modified. Constant variables are the variables whose content also cannot be modified. […]
PowerShell – How to create Variables?
PowerShell allows us to create the variables. We use “$” Symbol to create the variables. Through this Article, we will discuss more about defining the variables and PowerShell command(s) to support defining them. Create Variables in PowerShell Let’s take a simple example; PS C:\> $message = “Hello!” Here we have defined the variable $message and […]