Site icon Dotnet Helpers

PowerShell’s Variables

Windows PowerShell is designed to be an interactive command-line shell and it’s also a programming language. A PowerShell script is really nothing more than a simple text file. The file contains a series of PowerShell commands, with each command appearing on a separate line.

If we need to run the PowerShell script using the notepad then its filename needs to save as .PS1 extension.

Powershell Variables

Is It Case Sensitive

The answer is “YES”, power shell comments are case sensitive. 

Example : 1

Example : 2

Example : 3 Handling Dynamic Variables.

The Get-Variable cmdlet gets the PowerShell variables in the current console. You can retrieve just the values of the variables by specifying the ValueOnly parameter.

OUTPUT: This is specific MSG for Anna

 

Exit mobile version