Skip to content

Commit

Permalink
Update completers
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvs committed Feb 27, 2024
1 parent bf3be79 commit baf9b1b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion functions/DiskSmartInfo.completers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,18 @@ class DiskCompleter : IArgumentCompleter
{
$sessionParameters.Add('Credential', $fakeBoundParameters.Credential)
}
if ($cimSession = New-CimSession @sessionParameters)

$option = [Microsoft.Management.Infrastructure.Options.WSManSessionOptions]::new()
$option.Timeout = New-TimeSpan -Seconds 1

if ($cimSession = New-CimSession -SessionOption $option @sessionParameters)
{
$instanceParameters.Add('CimSession', $cimSession)
}
else
{
return $result
}
}
elseif ($fakeBoundParameters.ContainsKey('CimSession'))
{
Expand Down

0 comments on commit baf9b1b

Please sign in to comment.