Windows PowerShell modules provide a convenient way to package reusable ode by using modules.
The concept of modules is a package that contains Windows PowerShell version 2.0 commands.
Anyone can write and install a Windows PowerShell script module with administrator rights.
There is three default location for Windows PowerShell modules: home users, Windows PowerShell home directory and the last is for Windows PowerShell version 4.0 into ProgramFiles\WindowsPowerShell\Modules directory.
To see all of the PowerShell modules use :
1 | PS C:\WINDOWS\system32> Get-Module -ListAvailable |
Let’s test some modules
1 2 3 4 | PS C:\WINDOWS\system32> Get-NetFirewallProfile PS C:\WINDOWS\system32> Get-NetIPAddress -AddressFamily IPv4 PS C:\WINDOWS\system32> Get-NetIPAddress -AddressFamily IPv6 PS C:\WINDOWS\system32> Get-NetConnectionProfile |
Let’s set to Private connection:
1 | PS C:\WINDOWS\system32> Get-NetConnectionProfile | Set-NetConnectionProfile -NetworkCategory Private |