Skip to content

Instantly share code, notes, and snippets.

@MyITGuy
Created September 26, 2019 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MyITGuy/3fa71fdc240a15e8f7e62d46df438d1a to your computer and use it in GitHub Desktop.
Save MyITGuy/3fa71fdc240a15e8f7e62d46df438d1a to your computer and use it in GitHub Desktop.
#region Get-AltirisDeploymentAgentConfig
function Get-AltirisDeploymentAgentConfig {
[CmdletBinding()]
PARAM(
[Parameter(Mandatory = $false, Position = 0, ValueFromPipeline = $true)]
[string]
$ComputerName
)
begin {
Write-Verbose $MyInvocation.MyCommand
}
process {
try {
if ($ComputerName) {
$key = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $ComputerName)
}
else {
$key = [Microsoft.Win32.Registry]::LocalMachine
}
$subkey = $key.OpenSubKey('SOFTWARE\Altiris\Client Service')
$Properties = @{}
$subkey.GetValueNames() | ForEach-Object {
$Properties."$_" = $subkey.GetValue($_)
}
$obj = New-Object -TypeName PSObject -Property $Properties
Write-Output -InputObject $obj
}
catch {
Throw $_
}
}
end {
}
}
#endregion Get-AltirisDeploymentAgentConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment