Types/System.ServiceProcess.ServiceController.types.ps1xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <Types> <Type> <Name>System.ServiceProcess.ServiceController</Name> <Members> <ScriptMethod> <Name>GetServiceConfigProperty</Name> <Script> param( [Parameter(Mandatory=$true)] [string] # The name of the property to retrieve. $Name ) Set-StrictMode -Version 'Latest' if( -not ($this | Get-Member -Name 'Configuration') ) { $value = $null try { $value = New-Object 'Carbon.Service.ServiceInfo' $this.Name,$this.MachineName } catch { $ex = $_.Exception while( $ex.InnerException ) { $ex = $ex.InnerException } if( $Global:Error.Count -gt 0 ) { $Global:Error.RemoveAt(0) } Write-Error ('Failed to load extended service information for service ''{0}'' on ''{1}'': {2}' -f $this.Name,$this.MachineName,$ex.Message) } Add-Member -InputObject $this -MemberType NoteProperty -Name 'Configuration' -Value $value } if( -not $this.Configuration ) { return } if( -not ($this.Configuration | Get-Member -Name $Name) ) { return } return $this.Configuration.$Name </Script> </ScriptMethod> <ScriptProperty> <Name>DelayedAutoStart</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'DelayedAutoStart' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Description</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'Description' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>ErrorControl</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'ErrorControl' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>FailureProgram</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'FailureProgram' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>FirstFailure</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'FirstFailure' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>LoadOrderGroup</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'LoadOrderGroup' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>Path</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'Path' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>RebootDelay</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'RebootDelay' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>RebootDelayMinutes</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'RebootDelayMinutes' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>RebootMessage</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'RebootMessage' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>ResetPeriod</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'ResetPeriod' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>ResetPeriodDays</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'ResetPeriodDays' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>RestartDelay</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'RestartDelay' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>RestartDelayMinutes</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'RestartDelayMinutes' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>RunCommandDelay</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'RunCommandDelay' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>RunCommandDelayMinutes</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'RunCommandDelayMinutes' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>SecondFailure</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'SecondFailure' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>StartMode</Name> <GetScriptBlock> $startType = $this.GetServiceConfigProperty( 'StartType' ) if( $startType -ne $null ) { [System.ServiceProcess.ServiceStartMode][int]$startType } </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>StartType</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'StartType' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>TagID</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'TagID' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>ThirdFailure</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'ThirdFailure' ) </GetScriptBlock> </ScriptProperty> <ScriptProperty> <Name>UserName</Name> <GetScriptBlock> $this.GetServiceConfigProperty( 'UserName' ) </GetScriptBlock> </ScriptProperty> </Members> </Type> </Types> |