Eug*_*ban 3 powershell execution
在powershell中,与在 中一样cmd,您必须键入文件的路径,包括文件本身,或者如果您与文件所在的位置相同,则只需键入文件名,下面显示了每种情况的示例:
# if the file is a different location
[Path to the file]\[fileName]
# if the file is in the same location
.\[fileName]
Run Code Online (Sandbox Code Playgroud)
我想要做的是将文件的路径分配给一个变量,当我想打开文件时只需键入变量名称,如下所示:
$path = [fileLocation + fileName]
Run Code Online (Sandbox Code Playgroud)
但是,问题是,当我键入变量时,PowerShell 会返回 的字符串值$path,因此,如何通过将文件的路径分配给变量来启动文件?
| 归档时间: |
|
| 查看次数: |
1860 次 |
| 最近记录: |