Monday, February 11, 2013

Powershell Script DIY: The easy command: Set-Location


     Setting your location is easy, and when done correctly, can give you a proper entry into the world of scripting. For this exercise we use the Set-Location command.

Set-Location

As with every Set command you need to set the value.  The value must always be encapsulated in quotations of some kind. The type of quotes are important.  Double " quotes are for normal non-literal use.  that is, if you put a variable in there, then the variable value will appear.  Single quotes tell Powershell to take the string literal, that is the variable itself will appear in the string, not its value:

Set-Location “c:\temp


As always, If you have anything to add, Post it below!

Edit: I had been misinformed on the use of the two kinds of quotation, this has been corrected.

No comments:

Post a Comment