diff --git a/samy.ps1 b/samy.ps1 index e8dd834..0c1389c 100644 --- a/samy.ps1 +++ b/samy.ps1 @@ -1846,6 +1846,7 @@ function Invoke-InstallPrinters { $clientCode = $p.ClientCode $profileName = $p.ProfileName $setDefault = $false + if ($p.PSObject.Properties.Name -contains 'SetAsDefault' -and $p.SetAsDefault) { $setDefault = $true } @@ -1857,11 +1858,11 @@ function Invoke-InstallPrinters { continue } - $summary = "ClientCode=$clientCode ProfileName=$profileName SetAsDefault=$setDefault" + $summary = "ClientCode=$clientCode ProfileName=$profileName DisplayName=$($p.DisplayName) Location=$($p.Location) SetAsDefault=$setDefault" Write-LogHybrid "WHATIF: Installing printer ($summary)" Info Printers -LogToEvent try { - # 🔐 SAFE PHASE: we call with -WhatIf so no real change happens + # SAFE PHASE: we call with -WhatIf so no real change happens Invoke-SamyPrinterInstall ` -ClientCode $clientCode ` -ProfileName $profileName `