powershell - Command runs in ISE but not as ps1 in Console -
i found numerous threads , went through them none of them adressed issue. try keep short.
new-psdrive –name "g" –psprovider filesystem –root "\\dom\dfs\dom-loc-share" –persist
it works fine if run ise. works fine when copy paste console. not work if try running ps1 in console.
- i restarted ise
- i checked , both run in single threaded apartment
- executionpolicy unrestricted
- i run both administrator
can please me?
use -scope global
, more information visit technet article:
about_scopes https://technet.microsoft.com/en-us/library/hh847849.aspx
[...] windows powershell protects access variables, aliases, functions, , windows powershell drives (psdrives) limiting can read , changed. enforcing few simple rules scope, windows powershell helps ensure not inadvertently change item should not changed. [...]
new-psdrive –name "g" –psprovider filesystem –root "\\dom\dfs\dom-loc-share" –persist -scope global
Comments
Post a Comment