Updated Ansible scripts
Cleaner output, with focus on last lines of output by default
This commit is contained in:
parent
7cb9f09c8c
commit
a64d3c83af
|
@ -38,7 +38,7 @@ Invoke-Expression $expr | ForEach-Object {
|
|||
Machine = $res[0].Trim();
|
||||
Status = @($res[1].Trim(), "$($res[2])".Trim())
|
||||
RunTime = $sw.Elapsed
|
||||
Output = "$($res[3])".Trim();
|
||||
Output = "$($res[3])".Trim() -split '\\n';
|
||||
})
|
||||
if( $res.Status -match '^\w+!:' ) {
|
||||
[Console]::ForegroundColor = [ConsoleColor]::Red
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
[CmdletBinding()]param(
|
||||
[string[]]$Remotes = 'All',
|
||||
[switch]$RawOutput
|
||||
[switch]$RawOutput,
|
||||
[switch]$PassThruOnly
|
||||
)
|
||||
|
||||
Invoke-ViaAnsible -Command "Update-OSz -Mode Auto" -Remotes:$($Remotes.ToLower()) -RawOutput:$RawOutput
|
||||
Invoke-ViaAnsible -Command "Update-OSz -Mode Auto" -Remotes:$($Remotes.ToLower()) -RawOutput:$RawOutput | ForEach-Object {
|
||||
if( $PassThru ) { return $_ }
|
||||
$_ | Select-Object Machine, RunTime, @{L='Output';E={$_.Output | Select-Object -last 4}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue