Skip to content

Instantly share code, notes, and snippets.

@mattvanstone
mattvanstone / set-ssh.ps1
Created January 29, 2016 18:26
Set-SSH PowerCLI Function - Start/Stop the ESXi SSH service from PowerCLI
<#
.SYNOPSIS
Start or stop SSH on an ESXi host
.DESCRIPTION
Takes a hostname or a piped Get-VMHost object starts or stops the SSH service depending on the value of the State parameter
.PARAMETER VMHost
The name of a host to start ssh on or a VMHost object
.PARAMETER State
State to set the SSH service to. Valid values are Start or Stop
.EXAMPLE