Skip to content

Instantly share code, notes, and snippets.

@soulhakr
Last active May 10, 2022 22:37
Show Gist options
  • Save soulhakr/8fda29f00cbefe0b11463f69280dbb67 to your computer and use it in GitHub Desktop.
Save soulhakr/8fda29f00cbefe0b11463f69280dbb67 to your computer and use it in GitHub Desktop.
[Get Remote Hostname (Powershell)] #powershell #pwsh #utility
Invoke-Command -ComputerName (Read-Host -Prompt 'Enter the computer IP') -ScriptBlock { [System.Net.Dns]::GetHostName() } -Credential (Get-Credential)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment