Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
-
2
-
Windows 2016-05-04, Windows 2016-05-18
Description
As part of MODULES-2962 it was discovered that the stdout output was different between 1.x and 2.x of the module. This ticket will change the behaviour of 2.x module to look like that of 1.x where appropriate.
Also the DEBUG output should show the decoded XML from the powershellmanager instead of the base64 encoded text.
Example issue
Manifest
exec
|
{ 'show ps': command => '$PSVersionTable', provider => powershell, logoutput => false }
|
->
|
exec
|
{ 'onlyif check exit 0': command => '"OnlyifExit0"', onlyif => 'exit 0', provider => powershell, }
|
->
|
exec
|
{ 'onlyif check exit 1': command => '"OnlyifExit1"', onlyif => 'exit 1', provider => powershell, }
|
->
|
exec
|
{ 'onlyif check noexit': command => '"OnlyifNoExit"', onlyif => '', provider => powershell, }
|
->
|
|
exec
|
{ 'unless check exit 0': command => '"unlessExit0"', unless => 'exit 0', provider => powershell, }
|
->
|
exec
|
{ 'unless check exit 1': command => '"unlessExit1"', unless => 'exit 1', provider => powershell, }
|
->
|
exec
|
{ 'unless check noexit': command => '"unlessNoExit"', unless => '', provider => powershell, }
|
->
|
|
exec { 'write-host':
|
command => 'Write-Host "Hello"',
|
provider => powershell,
|
logoutput => true
|
}
|
|
exec { 'write-verbose':
|
command => '$VerbosePreference = "Continue";Write-Verbose "Hello"',
|
provider => powershell,
|
logoutput => true
|
}
|
|
exec { 'write-debug':
|
command => '$debugPreference = "Continue";Write-debug "Hello"',
|
provider => powershell,
|
logoutput => true
|
}
|
|
exec { 'write-warning':
|
command => 'Write-warning "Hello"',
|
provider => powershell,
|
logoutput => true
|
}
|
|
exec { 'write-error':
|
command => 'Write-error "Hello"',
|
provider => powershell,
|
logoutput => true
|
}
|
|
exec { 'write-progress':
|
command => 'for ($i = 1; $i -le 100; $i++ ){write-progress -activity "Search in Progress" -status "$i% Complete:" -percentcomplete $i;}',
|
provider => powershell,
|
logoutput => true
|
}
|
|
exec { 'write-output':
|
command => 'Write-output "Hello"',
|
provider => powershell,
|
logoutput => true
|
}
|
|
exec { 'write-host - never log':
|
command => 'Write-host "Should not see this"',
|
provider => powershell,
|
logoutput => false
|
}
|
|
exec { 'write-host - log on error (no error)':
|
command => 'Write-host "Should not see this"',
|
provider => powershell,
|
logoutput => on_failure
|
}
|
|
exec { 'write-host - log on error (with error)':
|
command => 'Write-host "Should see this"; exit 1',
|
provider => powershell,
|
logoutput => on_failure
|
}
|
Old
C:\Users\Administrator>"c:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" apply c:\temp\test.pp --modulepath c:\temp\modules --verbose
|
Notice: Compiled catalog for win-edson23cglf.localdomain in environment production in 0.16 seconds
|
Info: Applying configuration version '1457119480'
|
Notice: /Stage[main]/Main/Exec[show ps]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[onlyif check exit 0]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[onlyif check noexit]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[unless check exit 1]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-host]/returns: Hello
|
Notice: /Stage[main]/Main/Exec[write-host]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-verbose]/returns: Hello
|
Notice: /Stage[main]/Main/Exec[write-verbose]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-warning]/returns: WARNING: Hello
|
Notice: /Stage[main]/Main/Exec[write-warning]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-error]/returns: Write-error "Hello" : Hello
|
Notice: /Stage[main]/Main/Exec[write-error]/returns: + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
|
Notice: /Stage[main]/Main/Exec[write-error]/returns: + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException
|
Notice: /Stage[main]/Main/Exec[write-error]/returns:
|
Error: Write-error "Hello" returned 1 instead of one of [0]
|
Error: /Stage[main]/Main/Exec[write-error]/returns: change from notrun to 0 failed: Write-error "Hello" returned 1 instead of one of [0]
|
Notice: /Stage[main]/Main/Exec[write-progress]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-output]/returns: Hello
|
Notice: /Stage[main]/Main/Exec[write-output]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[commandexit5]/returns: executed successfully
|
Info: Class[Main]: Unscheduling all events on Class[Main]
|
Notice: Applied catalog in 17.84 seconds
|
New PR
C:\Users\Administrator>"c:\Program Files\Puppet Labs\Puppet\bin\puppet.bat" apply c:\temp\test.pp --modulepath c:\source --verbose
|
Info: Loading facts
|
Notice: Compiled catalog for win-edson23cglf.localdomain in environment production in 0.22 seconds
|
Info: Applying configuration version '1457119515'
|
Notice: /Stage[main]/Main/Exec[show ps]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[onlyif check exit 0]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[onlyif check noexit]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[unless check exit 1]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-host]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-verbose]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-warning]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-error]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-progress]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[write-output]/returns: Hello
|
Notice: /Stage[main]/Main/Exec[write-output]/returns: executed successfully
|
Notice: /Stage[main]/Main/Exec[commandexit5]/returns: executed successfully
|
Notice: Applied catalog in 10.03 seconds
|
Attachments
Issue Links
- blocks
-
MODULES-3280 Powershell - Remove Verbose Environment Variable Setting
-
- Resolved
-
-
MODULES-3333 PowerShell - Create Acceptance Test for "logoutput"
-
- Closed
-
- is blocked by
-
MODULES-2962 Extend reusing PowerShell session improvements to PowerShell Module
-
- Resolved
-
- relates to
-
MODULES-3280 Powershell - Remove Verbose Environment Variable Setting
-
- Resolved
-
-
MODULES-3347 Windows module autoloading can cause spec test failures in Powershell Module
-
- Resolved
-
-
MODULES-3346 PowerShell - Internationalize Log Stream Output
-
- Accepted
-
-
MODULES-3486 PowerShell - When logging, use exact same prefix strings as PS itself for debug, info, verbose streams
-
- Closed
-
- links to