![]() Initially a Windows component only, known as Windows PowerShell, it was made open-source and cross-platform on August 18, 2016, with the introduction of PowerShell Core. PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Python, Ksh, Perl, C#, CL, DCL, SQL, Tcl, Tk, Chef, Puppet I gave suggestions of edits that could make this transition from the legacy method to the new method more graceful. I also suggested referencing the previous way to perform the same operation to help readers that are familiar with the legacy method identify "this is the new method" My feedback was to put something in the article that explains how to get the drive to be persistent between reboots, and until it does so, I will consider the documentation incomplete. Hello, would you share where in the description of the "scope" parameter it indicates using a scope of "global" will cause the drive mapping to persist between reboots? In my experience even global variables are cleared when the powershell session is terminated. GitHub Login: Microsoft Alias: dongbow.Content Source: reference/7.1//New-PSDrive.md.It is required for ➟ GitHub issue linking. No comment on how to have mapped drives appear in standard windows tools after a reboot. Summary: drives mapped using New-PSDrive can be managed using standard windows tools by using the -Persist switch. They're persistent, not session-specific, and can be viewed and managed in File Explorer and other tools. Mapped network drives are saved in Windows on the local computer. When your command is scoped locally, no dot-sourcing, the Persist parameter doesn't persist the creation of a PSDrive beyond the scope in which the command is running. Mapped network drives must have a drive-letter name and be connected to a remote file system location. They're saved in Windows and they can be managed by using standard Windows tools, such as File Explorer and net use. Unlike temporary PowerShell drives, Windows mapped network drives aren't session-specific. You can use the Persist parameter of New-PSDrive to create Windows mapped network drives. Use /persistent for the mapped drive to appear in standard windows tools after a reboot. Summary: drives mapped using net use are always manageable using standard windows tools. Use /delete to remove persistent connections. Existing connections are restored at the next logon. Deviceless connections are not persistent. Yes saves all connections as they are made, and restores them at next logon. No does not save the connection being made or subsequent connections. persistent: | Controls the use of persistent network connections. ![]() Update the top paragraph about the new "Persist" switch and add a statement along the lines ofĭrives mapped using New-PSDrive -Persist are not restored at next login, use (new powershell method? or "net use /persist") to create a drive mapping that is restored at next login. Update the parameter description to specify poweshell session. How do have a New-PSDrive persist, and not persist between reboots? Current windows session was my assumption, but experience tells me it is the current powershell session. Reading through the article for New-PSDrive I see no indication how to make drives persist across reboot or only the current session. Reading through the description of net use /persistent, it clearly says it preserves mapping between reboot. And, that the current documentation doesn't appear to acknowledge this shift in meaning between the two commands. Share feedback that the New-PSDrive parameters created a misunderstanding that I spent at least an hour trying to troubleshoot due to this misunderstanding. ![]() Was on the phone with a member of the azure files team troubleshooting why drive mapping wasn't showing up as a drive letter, and they too were unaware that the -persistent behavior in this command behaves differently from net use. To preserve drive mapping between reboots. I assume that Microsoft is using the term in powershell in the same way the use it in net use. When I look at the powershell snipit provided by Azure it includes the "Persist" switch. I want to map a drive but not keep it between reboots. Azure Files provides a powershell snipit for mapping a file. net use uses "persistent" to keep drive mappings across reboots. I'm familiar with net use, and map network drives frequently.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |