Title: New-Service Should Throw on System StartupType · Issue #4803 · PowerShell/PowerShell · GitHub
Open Graph Title: New-Service Should Throw on System StartupType · Issue #4803 · PowerShell/PowerShell
X Title: New-Service Should Throw on System StartupType · Issue #4803 · PowerShell/PowerShell
Description: Note: The test case @{name = 'badstarttype'; parameter = "StartupType"; value = "System"} from test\powershell\Modules\Microsoft.PowerShell.Management\Set-Service.Tests.ps1 failed in daily test run due to this issue, so it's disabled for...
Open Graph Description: Note: The test case @{name = 'badstarttype'; parameter = "StartupType"; value = "System"} from test\powershell\Modules\Microsoft.PowerShell.Management\Set-Service.Tests.ps1 failed in daily test run...
X Description: Note: The test case @{name = 'badstarttype'; parameter = "StartupType"; value = "System"} from test\powershell\Modules\Microsoft.PowerShell.Management\Set-Service.Tests....
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/4803
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New-Service Should Throw on System StartupType","articleBody":"Note: The test case `@{name = 'badstarttype'; parameter = \"StartupType\"; value = \"System\"}` from `test\\powershell\\Modules\\Microsoft.PowerShell.Management\\Set-Service.Tests.ps1` failed in daily test run due to this issue, so it's disabled for now. Please re-enable the test when fixing this issue.\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\nNew-Service -StartupType System -Name badstarttype -BinaryPathName \"$PSHOME\\powershell.exe\" -ErrorAction Stop\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\nShould throw \r\n\r\n```none\r\nCouldNotNewService,Microsoft.PowerShell.Commands.NewServiceCommand\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\nCreates Service when run on release build\r\n\r\n```none\r\nName : badstarttype\r\nRequiredServices :\r\nCanPauseAndContinue : False\r\nCanShutdown : False\r\nCanStop : False\r\nDisplayName : badstarttype\r\nDependentServices : {}\r\nMachineName : .\r\nServiceName : badstarttype\r\nServicesDependedOn :\r\nStartType :\r\nServiceHandle : Microsoft.Win32.SafeHandles.SafeServiceHandle\r\nStatus : Stopped\r\nServiceType : Win32OwnProcess\r\n```\r\n\r\nFails Fast on debug build:\r\n\r\n```none\r\nFailFast: bad StartupType\r\n\r\n at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage)\r\n at System.Management.Automation.Diagnostics.Assert(Boolean condition, String whyThisShouldNeverHappen, String detailMessage) in C:\\github\\PowerShell\\src\\System.Management.Automation\\utils\\assert.cs:line 196\r\n at System.Management.Automation.Diagnostics.Assert(Boolean condition, String whyThisShouldNeverHappen) in C:\\github\\PowerShell\\src\\System.Management.Automation\\utils\\assert.cs:line 131\r\n at Microsoft.PowerShell.Commands.NewServiceCommand.BeginProcessing() in C:\\github\\PowerShell\\src\\Microsoft.PowerShell.Commands.Management\\commands\\management\\Service.cs:line 2018\r\n at System.Management.Automation.Cmdlet.DoBeginProcessing() in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\cmdlet.cs:line 164\r\n at System.Management.Automation.CommandProcessorBase.DoBegin() in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\CommandProcessorBase.cs:line 500\r\n at System.Management.Automation.CommandProcessor.DoBegin() in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\CommandProcessor.cs:line 272\r\n at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\pipeline.cs:line 1050\r\n at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\pipeline.cs:line 489\r\n at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\runtime\\Operations\\MiscOps.cs:line 455\r\n at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\interpreter\\CallInstruction.Generated.cs:line 569\r\n at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\interpreter\\ControlFlowInstructions.cs:line 356\r\n at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\interpreter\\ControlFlowInstructions.cs:line 356\r\n at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\interpreter\\Interpreter.cs:line 111\r\n at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\interpreter\\LightLambda.Generated.cs:line 78\r\n at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\ScriptCommandProcessor.cs:line 516\r\n at System.Management.Automation.DlrScriptCommandProcessor.Complete() in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\ScriptCommandProcessor.cs:line 417\r\n at System.Management.Automation.CommandProcessorBase.DoComplete() in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\CommandProcessorBase.cs:line 614\r\n at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\pipeline.cs:line 607\r\n at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input) in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\pipeline.cs:line 519\r\n at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper() in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\hostifaces\\LocalPipeline.cs:line 426\r\n at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc() in C:\\github\\PowerShell\\src\\System.Management.Automation\\engine\\hostifaces\\LocalPipeline.cs:line 622\r\n at System.Threading.Thread.ThreadMain_ThreadStart()\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n\r\n at System.Environment.FailFast(System.String, System.Exception)\r\n at System.Management.Automation.Diagnostics.Assert(Boolean, System.String, System.String)\r\n at System.Management.Automation.Diagnostics.Assert(Boolean, System.String)\r\n at Microsoft.PowerShell.Commands.NewServiceCommand.BeginProcessing()\r\n at System.Management.Automation.Cmdlet.DoBeginProcessing()\r\n at System.Management.Automation.CommandProcessorBase.DoBegin()\r\n at System.Management.Automation.CommandProcessor.DoBegin()\r\n at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean)\r\n at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object)\r\n at System.Management.Automation.PipelineOps.InvokePipeline(System.Object, Boolean, System.Management.Automation.CommandParameterInternal[][], System.Management.Automation.Language.CommandBaseAst[], System.Management.Automation.CommandRedirection[][], System.Management.Automation.Language.FunctionContext)\r\n at System.Management.Automation.Interpreter.ActionCallInstruction`6[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(System.Management.Automation.Interpreter.InterpretedFrame)\r\n at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)\r\n at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(System.Management.Automation.Interpreter.InterpretedFrame)\r\n at System.Management.Automation.Interpreter.Interpreter.Run(System.Management.Automation.Interpreter.InterpretedFrame)\r\n at System.Management.Automation.Interpreter.LightLambda.RunVoid1[[System.__Canon, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon)\r\n at System.Management.Automation.DlrScriptCommandProcessor.RunClause(System.Action`1\u003cSystem.Management.Automation.Language.FunctionContext\u003e, System.Object, System.Object)\r\n at System.Management.Automation.DlrScriptCommandProcessor.Complete()\r\n at System.Management.Automation.CommandProcessorBase.DoComplete()\r\n at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(System.Management.Automation.CommandProcessorBase)\r\n at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(System.Object)\r\n at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()\r\n at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()\r\n at System.Threading.Thread.ThreadMain_ThreadStart()\r\n at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-beta\r\nPSEdition Core\r\nGitCommitId v6.0.0-beta.6-43-g2761c3ff210caf7a9c18968c03c18c6921046251\r\nOS Microsoft Windows 10.0.15063\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n\r\n```\r\n\r\nRef #4785 ([comment](https://github.com/PowerShell/PowerShell/pull/4785#discussion_r137960812))","author":{"url":"https://github.com/markekraus","@type":"Person","name":"markekraus"},"datePublished":"2017-09-10T22:05:20.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/4803/PowerShell/issues/4803"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d0d01512-251e-0648-9fdb-6fae107b7693 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8DA:3B01A6:183A08:21B653:6A579DD1 |
| html-safe-nonce | 185052a82a9311e1b9d40155d195da238d269d0500348101ff441deb7ca9f2a3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOERBOjNCMDFBNjoxODNBMDg6MjFCNjUzOjZBNTc5REQxIiwidmlzaXRvcl9pZCI6Ijg4ODQ5MTEyMjUzOTE1MjEyMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cc657e1b1e9a2be86f5e1784ccdaffc7690a6a8190a4e86797e16f5f6559957c |
| hovercard-subject-tag | issue:256543875 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/4803/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b7898d85a596cde9ceeeff0eae2dba2e6a8de39f49573647036df1e7ed0f5014/PowerShell/PowerShell/issues/4803 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b7898d85a596cde9ceeeff0eae2dba2e6a8de39f49573647036df1e7ed0f5014/PowerShell/PowerShell/issues/4803 |
| og:image:alt | Note: The test case @{name = 'badstarttype'; parameter = "StartupType"; value = "System"} from test\powershell\Modules\Microsoft.PowerShell.Management\Set-Service.Tests.ps1 failed in daily test run... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markekraus |
| hostname | github.com |
| expected-hostname | github.com |
| None | 017a07c29bdd8a37b5907fc9a689338deb7103b5af7f56714193b2700229b3df |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0dd6847d644323df8f8c1368c065f9f630095e3b |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width