Skip to content

Commit 067c758

Browse files
committed
Don't write out null servers.
1 parent 8858cb7 commit 067c758

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

NtObjectManager/RpcFunctions.ps1

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,14 +336,17 @@ function Get-RpcServer {
336336
}
337337
}
338338
}
339-
if ($AsText) {
340-
foreach ($server in $servers) {
341-
$text = $server.FormatAsText($RemoveComments)
342-
Write-Output $text
339+
340+
if ($null -ne $servers) {
341+
if ($AsText) {
342+
foreach ($server in $servers) {
343+
$text = $server.FormatAsText($RemoveComments)
344+
Write-Output $text
345+
}
346+
}
347+
else {
348+
Write-Output $servers
343349
}
344-
}
345-
else {
346-
Write-Output $servers
347350
}
348351
}
349352
catch {

0 commit comments

Comments
 (0)