Run Multiple Commands on Remote Machine

# Create a persistent connection to remote machine
$Session = New-PSSession -ComputerName $Computer -Credential $Credential

# Runs on remote machine
Invoke-Command -Session $Session -ScriptBlock {Stop-Service -Name Bits}

# Run on local machine
Get-Service

# Runs on remote machine again
Invoke-Command -Session $Session -ScriptBlock {Start-Service -Name Bits}
Details
Use the New-PSSession to creae a persistent connection to a remote machine. This allows you to call the remote machine multiple times within a single script, without the need to reinitialize your session.