Configure IP using PowerShell on Windows

Get-NetIpAddress

Gets the IP address configuration.

Get-NetIpAddress | select InterfaceAlias,IpAddress,InterfaceIndex

Set IP Address:

Get-NetIpAddress -InterfaceAlias 'WiFi' | New-NetIpAddress  IpAddress 10.2.20.22  -PrefixLength 24 -DefaultGateway 10.2.20.254

Get-NetIPAddress
[[-IPAddress] <String[]>]
[-InterfaceIndex <UInt32[]>]
[-InterfaceAlias <String[]>]
[-AddressFamily <AddressFamily[]>]
[-Type <Type[]>]
[-PrefixLength <Byte[]>]
[-PrefixOrigin <PrefixOrigin[]>]
[-SuffixOrigin <SuffixOrigin[]>]
[-AddressState <AddressState[]>]
[-ValidLifetime <TimeSpan[]>]
[-PreferredLifetime <TimeSpan[]>]
[-SkipAsSource <Boolean[]>]
[-AssociatedIPInterface <CimInstance>]
[-PolicyStore <String>]
[-IncludeAllCompartments]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[<CommonParameters>]