Reputation: 598
This script is supposed to create some new drives but after i run it they dont exist, any ideas why? totally stuck.... Thanks in advance
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
Upvotes: 0
Views: 47
Reputation: 2728
you need to add the -Persist
parameter to your New-PSDrive
calls. otherwise it will only create the drive within your powershell session.
Upvotes: 1