79212656

Date: 2024-11-21 19:27:49
Score: 1
Natty:
Report link

When using a ps1 file, actually you need to change your script, replace the line New-PSDrive -Name [Drive Letter] -PSProvider FileSystem -Root "\\[Azure URL]\[Path]" -Persist to: net use [Drive Letter]: "\\[Azure URL]\[Path]" /persistent:yes

Using New-PSDrive will map the Drive only while the script is running, and using -Scope "Global" will map the drive while the PS session is not terminated, in other words, the map will go after you reboot the computer.

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When
  • Low reputation (1):
Posted by: Raúl Castillo