使用powershell访问我的共享文件夹的脚本
我有一个脚本,可以在本地计算机上使用powershell ise运行ps1文件<代码>&C:\Users\medetrax\Documents\Visual Studio 2013\Projects\Ward Obs Roaming\Ward Obs Roaming\AppPackages\Ward Obs Roaming\U 2.4.2.34\U AnyCPU\U Test\Add AppDevPackage.ps1' 不过,我现在已将该ps1文件放在我的服务器上,并希望使用共享文件夹从powershell访问它。我将在powershell中为此使用什么脚本使用powershell访问我的共享文件夹的脚本,powershell,powershell-ise,Powershell,Powershell Ise,我有一个脚本,可以在本地计算机上使用powershell ise运行ps1文件&C:\Users\medetrax\Documents\Visual Studio 2013\Projects\Ward Obs Roaming\Ward Obs Roaming\AppPackages\Ward Obs Roaming\U 2.4.2.34\U AnyCPU\U Test\Add AppDevPackage.ps1' 不过,我现在已将该ps1文件放在我的服务器上,并希望使用共享文件夹从powersh
\\MEDEPADSERVER\Users\Public\app_folder\Ward Obs Roaming_2.4.2.34_AnyCPU_Test
我已经尝试了net use\\MEDEPADSERVER\Users\Public\app\u folder\Ward Obs Roaming\u 2.4.2.34\u AnyCPU\u测试
但是我有网络路径错误,所以有人知道任何脚本吗?您需要先装载共享,然后使用以下路径访问它:
New-PSDrive -Name "Z" PSProvider Filesystem -Root \\MEDEPADSERVER\Users
Test-Path "Z:\Public\app_folder\Ward Obs Roaming_2.4.2.34_AnyCPU_Test"
如果您得到True
作为响应,则驱动器映射正确,您可以按以下方式执行脚本:
& 'Z:\Public\app_folder\Ward Obs Roaming_2.4.2.34_AnyCPU_Test\Add-AppDevPackage.ps1'
这假设您已在服务器上正确设置了共享,并且名为
Users
,并且指向服务器上的正确路径。您仍然可以通过本地计算机的UNC路径执行脚本
& '\\MEDEPADSERVER\Users\Public\app_folder\Ward Obs Roaming_2.4.2.34_AnyCPU_Test\Add-AppDevPackage.ps1'