All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

Login


All New Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated
adien's Avatar

adien / set_static.ps1

0 likes
0 forks
1 files
Last active 1717832781
1 $IP = "10.10.10.10"
2 $MaskBits = 24 # This means subnet mask = 255.255.255.0
3 $Gateway = "10.10.10.1"
4 $Dns = "10.10.10.100"
5 $IPType = "IPv4"
6 # Retrieve the network adapter that you want to configure
7 $adapter = Get-NetAdapter | ? {$_.Status -eq "up"}
8 # Remove any existing IP, gateway from our ipv4 adapter
9 If (($adapter | Get-NetIPConfiguration).IPv4Address.IPAddress) {
10 $adapter | Remove-NetIPAddress -AddressFamily $IPType -Confirm:$false
Newer Older

Powered by Opengist ⋅ Load: 16ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano Português Русский Türkçe Українська 中文 繁體中文