As a beginner: How can I place a path to folder in Powershell script? I would like to hard-code a path to a folder where the rest of the script would do some data munging. How to开发者_运维知识库 do that?
Do you mean?
$path = "C:\Windows"
Get-ChildItem $path
This will let you reference path in cmdlet parameters.
As per your comment:
Set-Location C:\Windows
will change working directory of the script to C:\Windows
精彩评论