【发布时间】:2016-11-04 13:58:18
【问题描述】:
这个脚本应该创建一些新的驱动器,但是在我运行它之后它们不存在,有什么想法吗?完全卡住了…… 提前致谢
Function New-Drives {
Param()
New-PSDrive -Name AppData -PSProvider FileSystem -Root $env:Appdata
New-PSDrive -Name Temp -PSProvider FileSystem -Root $env
$env:TEMP=Join-Path -Path C:\Windows\Temp
$mydocs=Join-Path -Path $env:userprofile -ChildPath Documents
New-PSDrive -Name Docs -PSProvider FileSystem -Root $mydocs
}
DIR temp: | measure-object –property length -sum
New-Drives
【问题讨论】:
标签: powershell scope environment-variables