1. Enable-ExperimentalFeature PSTempDrive
2. restart Powershell
3. Get-PSDrive, verify Temp .... Filesystem C:\Users\<username>\AppData\Local\Temp is listed
4. enter Temp:\ to acces PSTempDrive
changing to ~/Temp,
Temp:\ : The term 'Temp:\' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Temp:\
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (Temp:\:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Windows 10. 0.17763 64-bit.
---- -----
PSVersion 6.2.0-rc.1
PSEdition Core
GitCommitId 6.2.0-rc.1
OS Microsoft Windows 10.0.17763
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
This is a bit of a fun one, actually. If I recall carrectly, C: and similar are actual defined functions that essentially call Set-Location C:\, not something PS knows how to figure out on its own.
I guess @SteveL-msft forgot to add one for Temp:
Good point, @vexx32, though note that this nod to cmd.exe is only applied to "native" filesystem drives, not to _PS_ drives such as Temp:, so I don't think anything needs to be done here.
_Update_:
Functions A: through Z: are _blindly_ defined on startup, whether these drives exist or not.
While you can also define a custom PS-only drive for an unused drive _letter_ (singular) such as P:, any PS-only drives whose name comprises _multiple_ characters, such as HKLM: - or, in this case - Temp: - is implicitly excluded.
This has always been the case -- you can't HKLM: or whatever, and you can't C:\. The command C: is there for Command Prompt users.
BTW, C: is not Set-Location -LiteralPath C:\, it's Set-Location -LiteralPath C:, which preserves the current directory of drive C. This is a legacy of the transition from DOS to Windows.
Most helpful comment
This has always been the case -- you can't
HKLM:or whatever, and you can'tC:\. The commandC:is there for Command Prompt users.BTW,
C:is notSet-Location -LiteralPath C:\, it'sSet-Location -LiteralPath C:, which preserves the current directory of drive C. This is a legacy of the transition from DOS to Windows.