Untitled

mail@pastecode.io avatar
unknown
powershell
2 years ago
457 B
2
Indexable
Never
$IPv4 = [system.net.dns]::GetHostByName($env:COMPUTERNAME) | 
    Select-Object -ExpandProperty AddressList | 
    Where-Object -Property AddressFamily -EQ "InterNetwork" |
    Select-Object -ExpandProperty IPAddressToString

$hostname=$env:COMPUTERNAME

$output="IP: $IPv4`rHostname: $hostname"
output | Set-Clipboard

$wshell = New-Object -ComObject Wscript.Shell
$wshell.Popup("$output",0,"IP adresse og maskinnavn er kopiert til utklipp",0x1)