1

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
tsu90280
  • 417
  • 6
  • 20
  • Please post your sanitized (no actual credentials or real-world IP addresses) code. Are you trying to essentially do what Adam is describing in [this article](https://adamtheautomator.com/tfs-powershell-examples/)? – Darrell Mar 18 '21 at 08:32
  • @Darrell, I don't have to manage TFS from Powershell, in fact, it's the way around, I have to run PowerShell script from TFS – tsu90280 Mar 18 '21 at 13:14
  • are you saying the Powershell you need to run is stored in TFS or are you trying to manipulate Azure Pipelines via Powershell from within TFS? – Darrell Mar 18 '21 at 17:15
  • I want to run powershell on local machine from TFS – tsu90280 Mar 18 '21 at 22:29

1 Answers1

0

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

enter image description here

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39