1

I have a script to run a ps1 file using powershell ise on my local machine. & 'C:\Users\medetrax\Documents\Visual Studio 2013\Projects\Ward Obs Roaming\Ward Obs Roaming\AppPackages\Ward Obs Roaming_2.4.2.34_AnyCPU_Test\Add-AppDevPackage.ps1'

However I have now put that ps1 file on my server and wish to access it from powershell using shared folders. What script would I use in powershell for this

\\MEDEPADSERVER\Users\Public\app_folder\Ward Obs Roaming_2.4.2.34_AnyCPU_Test

I have tried net use \\MEDEPADSERVER\Users\Public\app_folder\Ward Obs Roaming_2.4.2.34_AnyCPU_Test but I get network path errors so does anyone know of any scripts?

2 Answers 2

1

You need to mount the share first, then access it using the path:

New-PSDrive -Name "Z" PSProvider Filesystem -Root \\MEDEPADSERVER\Users
Test-Path "Z:\Public\app_folder\Ward Obs Roaming_2.4.2.34_AnyCPU_Test"

If you get True as a response, the drive is mapped correctly and you could execute the script as:

&  'Z:\Public\app_folder\Ward Obs Roaming_2.4.2.34_AnyCPU_Test\Add-AppDevPackage.ps1'

This assumes that you've set up a share on your server correctly and is named Users and is pointing at the correct path on the server.

Sign up to request clarification or add additional context in comments.

Comments

0

You should still be able to execute the script via a UNC path from your local machine.

& '\\MEDEPADSERVER\Users\Public\app_folder\Ward Obs Roaming_2.4.2.34_AnyCPU_Test\Add-AppDevPackage.ps1'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.