-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Wrong output for New-Service in variable assignment and -OutVariable #10443
Copy link
Copy link
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.
Description
New-Service cmdlet's output doesn't have all properties when assigned to a variable or using -OutVariable
Steps to reproduce
♥->New-Service -Name TestService -BinaryPathName C:\windows\system32\cmd.exe -DisplayName test1 -Description test1 -StartupType Manual -OutVariable r
Status Name DisplayName
------ ---- -----------
Stopped TestService test1
♥->$r
#And
♥->$r = New-Service -Name TestService -BinaryPathName C:\windows\system32\cmd.exe -DisplayName test1 -Description test1 -StartupType Manual
♥->$rExpected behavior
♥->$r
Status Name DisplayName
------ ---- -----------
Stopped TestService test1
#And
♥->$r
Status Name DisplayName
------ ---- -----------
Stopped TestService test1
Actual behavior
♥->$r
Status Name DisplayName
------ ---- -----------
TestService test1
#And
♥->$r
Status Name DisplayName
------ ---- -----------
Environment data
Name Value
---- -----
PSVersion 7.0.0-preview.3
PSEdition Core
GitCommitId 7.0.0-preview.3
OS Microsoft Windows 10.0.18956
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-FixedThe issue is fixed.The issue is fixed.