Skip to content

Commit

Permalink
Invoke-CMApplyDriverPackage.ps1 version 2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
NickolajA committed Jun 24, 2019
1 parent 7d6e93b commit 8d495be
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,13 @@ Begin {
$ScriptVersion = "2.2.3"

# Load Microsoft.SMS.TSEnvironment COM object
try {
$TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Continue
}
catch [System.Exception] {
Write-Warning -Message "Unable to construct Microsoft.SMS.TSEnvironment object"
if ($PSCmdLet.ParameterSetName -like "Execute") {
try {
$TSEnvironment = New-Object -ComObject Microsoft.SMS.TSEnvironment -ErrorAction Continue
}
catch [System.Exception] {
Write-Warning -Message "Unable to construct Microsoft.SMS.TSEnvironment object"
}
}
}
Process {
Expand Down

0 comments on commit 8d495be

Please sign in to comment.