Questions tagged [new-psdrive]

A PowerShell cmdlet for defining custom drives, which typically map to filesystem locations.

From the docs:

The New-PSDrive cmdlet creates temporary and persistent drives that are mapped to or associated with a location in a data store, such as a network drive, a directory on the local computer, or a registry key, and persistent Windows mapped network drives that are associated with a file system location on a remote computer.

Only persistent drive definitions (-Persist), which are only supported on Windows, are visible to programs outside of PowerShell.

24 questions
0
votes
1 answer

How to use -Path in New-PSDrive : Powershell network drives

I've been reading though a lot of different posts describing how to access a network drive in Powershell, and the majority of them suggest using New-PSDrive, and then include some formatting usually looking somewhat like New-PSDrive -Name K…
billBrush
  • 1
  • 1
0
votes
1 answer

Check if PowerShell Drive has been set with if else statement

I'm trying to make a PowerShell script to modify the Registry values that set the default application for the .ps1 file extension. Sadly I wasn't able to get very far with the script because the PSDrive didn't have a path for HKEY_CLASSES_ROOT…
willowen100
  • 29
  • 1
  • 1
  • 4
0
votes
0 answers

New-PSDrive: A parameter cannot be found that matches parameter name 'Persist'

How do I create a persistent PSDrive on Linux? PS /home/nicholas> PS /home/nicholas> Get-PSDrive Name Used (GB) Free (GB) Provider Root …
0
votes
0 answers

How I can create own driver for variables in powershell

I whant to create driver for own variables in own scope. For example $myown:name = value I tried to do that with different values for -Root: New-PSDrive -Name myown -PSProvider Variable -Root /myown/ But that driver works like variable:. compare…
groser
  • 319
  • 1
  • 11
0
votes
1 answer

"Invalid directory on URL" while trying to use path created using New-PSDrive in Powershell

I have written a function to get authentication token. I have used New-PSDrive because PathTooLongException was thrown. Write-Host $adal, (Test-Path $adal) returns True while testing if path exists. But throws exception in LoadFrom(). Could someone…
Shridhar R Kulkarni
  • 6,653
  • 3
  • 37
  • 57
0
votes
2 answers

Create a virtual drive with PowerShell

I'm trying to create a D: drive in Windows, which points to some local directory (e.g. C:\DDrive) using PowerShell. This code runs fine: New-PSDrive -Name D -Root "C:\D_Drive\" -PSProvider "FileSystem" But in the Windows Explorer no D:-drive is…
Boris
  • 8,551
  • 25
  • 67
  • 120
0
votes
1 answer

Could not map network drive error after rebooting

I have two powershell scripts in each of which I need to write some information into a log file. The log file is stored on a network share. In the first script everything works as it should, the information is written to a file. After that, the…
-1
votes
1 answer

PowerShell mapped network drives not persisting after reboot

The command I'm running to map a network drive is: New-PSDrive -Name "M" -PsProvider "FileSystem" -Root "\\domain.com\filepath" -Persist -Scope Global -Credential $userCredentials The command maps the drive and the connection persists after closing…
-2
votes
2 answers

New-PSDrive drive mapping name

In my powershell script i am using New-PSDrive function to map remote server file path into my local computer as windows deployment operation proccess. I plan to reuse this Powershell script in the future, so i dont want any conflict between drives…
metzelder
  • 655
  • 2
  • 15
  • 35
1
2