Public/Invoke-GetComputer.ps1
function Invoke-GetComputer { <# .SYNOPSIS Gets information about a computer from PDQ inventory. .PARAMETER Computer Target computer .EXAMPLE !computer stnjn109.sunssc.local #> [PoshBot.BotCommand( CommandName = 'computer', Aliases = ('comp', 'info', 'getcomputer', 'pc') )] [cmdletbinding()] param( [parameter(Mandatory)] [string]$Computer ) $result = Invoke-Command -Computername pdq.sunssc.local -ScriptBlock { PDQInventory.exe getcomputer -Computer $Using:Computer } New-PoshBotCardResponse -Text ($result | Out-String) } |