Find installed software with Powershell, function

$livecred = get-credential

function findsoftware {
Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | where {$_.Publisher -match 'NetApp, Inc.'}
}

invoke-command -computername server1, server2, server3 -credential $livecred -ScriptBlock ${function:findsoftware}

NetApp snapmirror lagtime check cdot with PowerShell

# Snapmirror cleanup – update all snapmirrors with lagtime over one week and idle

$mirrors = @()

Get-NcSnapmirror | %{
$sm = “” | Select “Source”,”Destination”,”Status”,”State”,”LagTime”

$sm.Source = $_.SourceLocation
$sm.Destination = $_.DestinationLocation
$sm.Status = $_.Status
$sm.State = $_.MirrorState
$sm.LagTime = $_.LagTime

$mirrors += $sm

}

$mirrors

write-output $mirrors | export-csv snap.csv

# write-output $mirrors | Format-table -AutoSize

# write-Output $mirrors | where- {$sm.LagTime -gt 604800 -and $sm.Status -eq “idle”} | Format-Table -AutoSize