Skip to content

Instantly share code, notes, and snippets.

@bielawb
Created April 10, 2022 19:28
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 bielawb/262b209d1a410686ce0f9252088dcc0d to your computer and use it in GitHub Desktop.
Save bielawb/262b209d1a410686ce0f9252088dcc0d to your computer and use it in GitHub Desktop.
Wspólne parametry
$sesja = New-CimSession -ComputerName test -Credential $mojePoświadczenia
$wspólne = @{
CimSession = $sesja
ErrorAction = 'Stop'
}
try {
$os = Get-CimInstance @wspólne -ClassName Win32_OperatingSystem
$cs = Get-CimInstance @wspólne -ClassName Win32_ComputerSystem
} catch {
# obsługa błędów...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment