PowerShell for IT Professionals [#8] – Manage everything with PowerShell

Reading Time: < 1 minute
Using modules with PowerShell

Exercises

  • Can you uninstall module that was installed with Install-Module? Confirm your answer with Get-Module -ListAvaiable
  • Can you update the installed module?
  • Perhaps, you’d like to install version 1.0.0.0 of SNMP module, how can you force Install-Module to do so?

Install-Module error

If you encounter the issue with downloading modules, run this commandlet as a temporary workaround (it must be applied every time the shell is restarted):

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 

Source of solution, and also permanent solution can be found at:

https://answers.microsoft.com/en-us/windows/forum/windows_7-performance/trying-to-install-program-using-powershell-and/4c3ac2b2-ebd4-4b2a-a673-e283827da143?auth=1

Commands used in video:

Get-Command

Get-Command | Measure-Object

Get-Module -ListAvailable | Measure

#### About special shell
There's only one PowerShell. 
Let's review AD module for PowerShell.


#### SNMP
Let's use PS Gallery

Use SNMP module
Get-Command -Module SNMP

Invoke-SnmpWalk -IP 10.0.0.71 -Community public -OID ".1.3.6.1.2.1.1"

### VMWARE
Find-Module vmware*

#Install
Install-Module vmware.powercli

Get-command -Module vmware.powercli

Connect-ViServer

Get-VM

New-VM VM2

Get-VM VM2

Remove-VM VM2

0 comments on “PowerShell for IT Professionals [#8] – Manage everything with PowerShell

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.