简体   繁体   中英

Run Powershell script on remote server accessible through local IP

I am trying to create a PSSession from outside to a local machine basically using Azure tfs PowerShell task. The admin has given me a public IP, but I couldn't figure out how to use it. I get an error

Network Path not available.

The network is divided into multiple local machines and I have to run PS Script on one local machine accessible through 192.168.15.14 .

Any help or guide related to solving this issue.

You could try to create a remote session with the following code:

$session = New-PSSession -ComputerName ComputerName
Invoke-Command -Session $session -ScriptBlock { Set-Location D:\workspace}
Enter-PSSession -Session $session

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM