-
Notifications
You must be signed in to change notification settings - Fork 227
Add SQL Agent Operator management commands #2154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
johlju
merged 148 commits into
main
from
copilot/fix-2e4f4524-bcfc-418f-abb1-7eb2a7482232
Sep 12, 2025
Merged
Changes from all commits
Commits
Show all changes
148 commits
Select commit
Hold shift + click to select a range
c2c98b6
Initial plan
Copilot d3ab9aa
Add SQL Agent Operator commands and initial unit tests
Copilot f15a1ae
Complete SQL Agent Operator commands implementation with tests
Copilot e8c3673
Add Enable/Disable commands and extend New/Set commands with addition…
Copilot 72a112e
Add SMO stub enhancements and unit tests for Enable/Disable commands
Copilot 1baefd0
Merge branch 'main' into copilot/fix-2e4f4524-bcfc-418f-abb1-7eb2a748…
johlju 1113ccf
Fix Agent Operator test files to comply with current DSC community gu…
Copilot fad08ed
Remove trailing whitespace from all Agent Operator files and update P…
Copilot ad94ff6
Plan comprehensive fixes for Agent Operator commands and tests
Copilot 9b89cb9
Fix verbose messages in ShouldProcess blocks and error handling
Copilot 96328bd
Add comprehensive integration tests for all Agent Operator commands
Copilot f8ac585
Fix unit test parameter validation and improve mock setup
Copilot beab0ed
Address review comments: add Force parameter, use ErrorRecord::new(),…
Copilot 6f98eb7
Add ::new() guideline to PowerShell Code Organization section
Copilot a0f71d9
Fix exception handling and unit tests for Agent Operator commands
Copilot d58c2ce
Update PowerShell guidelines to clarify exception handling with local…
Copilot 3d38d09
Refactor Agent Operator error handling to use terminating errors and …
Copilot ed27bf6
Convert Assert-SqlDscAgentOperatorExists from private to public command
Copilot 00b6065
Add Force parameters, parameter validation, and refactor ShouldProces…
Copilot 36b79c8
Add begin-block validation to New-SqlDscAgentOperator and update unit…
Copilot 44111c4
Refactor Agent Operator error handling: rename Assert function, creat…
Copilot 96a93ea
Fix new line and whitespace
johlju 7866747
Fix whitespace and formatting inconsistencies across multiple scripts…
johlju 3c9d6ae
Enhance Get-AgentOperatorObject documentation: clarify behavior of Ig…
johlju 6f9f680
Refactor Get-AgentOperatorObject tests: enhance mock setup for operat…
johlju 57aa2f8
Refactor Get-SqlDscAgentOperator: replace direct operator retrieval w…
johlju dd479ce
Add Get-CommandParameters function to filter command parameters and u…
johlju dd30b92
Refactor Set-SqlDscAgentOperator: dynamically retrieve settable prope…
johlju f846486
Refactor parameter exclusion in ConvertTo-FormattedParameterDescripti…
johlju 72e8636
Refactor parameter handling in various functions: ensure named parame…
johlju 2979616
Refactor Get-CommandParameters function: rename to Get-CommandParamet…
johlju 8271673
Enhance error handling in agent operator functions: set $ErrorActionP…
johlju 12a7b83
Refactor Assert-SqlDscAgentOperator: replace Get-SqlDscAgentOperator …
johlju 57ecaf3
Add integration tests for Assert-SqlDscAgentOperator: implement test …
johlju 0659aa9
Enhance operator existence check in New-SqlDscAgentOperator: replace …
johlju e108759
Enhance error handling in New-SqlDscAgentAlert, New-SqlDscDatabase, a…
johlju c13f8ea
Refactor New-SqlDscAgentOperator to use static method for operator cr…
johlju 0a1d754
Add Refresh parameter to Get-AgentOperatorObject and enhance verbose …
johlju 562f8c3
Refactor Enable and Disable-SqlDscAgentOperator to utilize Refresh pa…
johlju c7f32cd
Add Refresh parameter to Test-SqlDscAgentOperator for improved operat…
johlju 1f8a700
Add Refresh parameter to New-SqlDscAgentOperator for improved operato…
johlju c9c7197
Refactor Remove-SqlDscAgentOperator to utilize Get-AgentOperatorObjec…
johlju 85de6db
Remove EmailAddress parameter from Test-SqlDscAgentOperator for clean…
johlju 6731148
Add Test-SqlDscIsAgentOperator function and associated tests for vali…
johlju 9234702
Refactor mock property initialization in JobServer to allow for defau…
johlju ed36734
Enhance Set-SqlDscAgentOperator tests to verify WhatIf behavior and e…
johlju 9aca26c
Update New-SqlDscAgentOperator tests to include Refresh parameter and…
johlju 71f1ed3
Refactor error handling in Assert-SqlDscAgentOperator tests to use th…
johlju 9d898be
Fix stream redirection in build script invocation to correctly handle…
johlju 9349d77
Set environment variable SqlServerDscCI for test isolation and cleanu…
johlju ab795e0
Add -ErrorAction 'Stop' to Connect-SqlDscDatabaseEngine calls for bet…
johlju b6dc583
Refactor credential creation for Connect-SqlDscDatabaseEngine to use …
johlju 2e45407
Remove expected message from Should -Throw assertion for New-SqlDscAg…
johlju b6cf887
Add -ErrorAction 'Stop' to Get-SqlDscAgentOperator calls for improved…
johlju 9568dcf
Add -ErrorAction 'Stop' to Get-SqlDscAgentOperator calls for improved…
johlju 205eea4
Add -ErrorAction 'Stop' to Connect-SqlDscDatabaseEngine calls for imp…
johlju f02547d
Remove expected message from Should -Throw assertion for non-existent…
johlju 90fe96b
Add -ErrorAction 'Stop' to Assert-SqlDscAgentOperator calls for impro…
johlju 1c83116
Refine documentation for Test-SqlDscIsAgentOperator to clarify its pu…
johlju 8f80b6e
Exclude 'Refresh' parameter from settable properties in New-SqlDscAge…
johlju b7092fc
Sort parameters alphabetically in ConvertTo-FormattedParameterDescrip…
johlju 6e576bc
Enhance ConvertTo-FormattedParameterDescription to mask SecureString …
johlju 244d12e
Optimize operator retrieval in Get-AgentOperatorObject by using direc…
johlju 97cdec6
Update error code in Disable-SqlDscAgentOperator to align with Disabl…
johlju cb0d39f
Add Refresh parameter to Remove-SqlDscAgentOperator and update relate…
johlju 9575776
Add Force parameter to New-SqlDscAgentAlert to bypass confirmation pr…
johlju 8fd7bf6
Add Force parameter to New-SqlDscAgentAlert and update tests to inclu…
johlju 02a61ea
Remove mock for Test-SqlDscAgentAlert in New-SqlDscAgentAlert.Tests
johlju 6c0ae8b
Remove unused strings for Remove-SqlDscAgentOperator and Test-SqlDscI…
johlju b370c68
Update expected parameters for Remove-SqlDscAgentOperator test to inc…
johlju 068ed6b
Update expected parameters for Test-SqlDscIsAgentOperator to remove E…
johlju c3dd9e7
Reorganize CHANGELOG.md: move 'Added' section and include new SQL Age…
johlju f151062
Remove redundant suppress message for PSUseDeclaredVarsMoreThanAssign…
johlju f7d2c46
Remove redundant suppress message for PSUseDeclaredVarsMoreThanAssign…
johlju 00cc750
Refactor environment variable handling in integration tests to use Re…
johlju e1bdf49
Update examples in New-SqlDscAgentOperator to include EmailAddress pa…
johlju 9394e50
Add EmailAddress parameter to New-SqlDscAgentOperator for test operat…
johlju a7044c9
Refactor New-SqlDscAgentOperator integration tests to remove redundan…
johlju 4b81010
Refactor Get-AgentOperatorObject to use ErrorAction for error handlin…
johlju ddc905b
Refactor Remove-SqlDscAgentOperator to use ErrorAction parameter for …
johlju 4000243
Enhance Remove-SqlDscAgentOperator to handle operator not found scena…
johlju 0abd442
Refactor Remove-SqlDscAgentOperator to use ErrorActionPreference for …
johlju 1c6e3c8
Refactor Remove-SqlDscAgentOperator to retrieve operator by name usin…
johlju 928e976
Enhance Remove-SqlDscAgentOperator tests to verify error handling for…
johlju 94eb03e
Enhance New-SqlDscAgentOperator tests to include email address parame…
johlju 9e05652
Enhance New-SqlDscAgentOperator tests to clean up additional test ope…
johlju 998eaaa
Enhance PowerShell guidelines to include return statement after Write…
johlju 1e68f69
Add Set-SqlDscConfigurationOption command and enhance Get-SqlDscConfi…
johlju bef5c7f
Enable and disable Agent XPs component in Set-SqlDscAgentOperator int…
johlju e56a105
Enhance Remove-SqlDscAgentOperator tests by adding Parent properties …
johlju 9e9af1a
Refactor New-SqlDscAgentOperator tests to suppress output by assignin…
johlju d790910
Remove redundant test for creating a new operator in New-SqlDscAgentO…
johlju 7059b06
Refactor Assert-SqlDscAgentOperator test to suppress output by assign…
johlju 0b0ab2e
Add -ErrorAction 'Stop' to Set-SqlDscConfigurationOption calls for im…
johlju 34c5771
Refactor Remove-SqlDscAgentOperator tests to suppress output by assig…
johlju 2986496
Refactor Assert-SqlDscAgentOperator tests to suppress output by assig…
johlju 2ba05f0
Change Write-Verbose to Write-Information for improved logging in Set…
johlju 879b9c0
Add guidance to set ConfirmImpact for ShouldProcess functions based o…
johlju 205f708
Enhance CmdletBinding attributes by adding ConfirmImpact for improved…
johlju 4ac3339
Add -Force parameter to Set-SqlDscConfigurationOption for Agent XPs t…
johlju c764e7a
Implement Force parameter handling in Set-SqlDscConfigurationOption t…
johlju dfc23a9
Add OutputType attribute to Set-SqlDscConfigurationOption for improve…
johlju 1cd6ce6
Add tests for Set-SqlDscConfigurationOption to validate parameter set…
johlju c718cfd
Fix null check for operator object retrieval in Get-AgentOperatorObje…
johlju 257ce03
Add SuppressMessage attributes to Get-SqlDscConfigurationOption and S…
johlju 563473d
Refactor parameter declaration in Get-SqlDscConfigurationOption and S…
johlju 5b73f88
Add -Force parameter to Add-Member for Configuration property in Set-…
johlju 2fa4a68
Remove unused pipeline input handling for ServerObject in Get-SqlDscC…
johlju 125fbb1
Add -Force parameter to Set-SqlDscAgentAlert in tests for improved fu…
johlju 182ae17
Remove unused SuppressMessage attribute for empty catch block in Set-…
johlju 9c89732
Add -Force parameter to Set-SqlDscAgentAlert calls in integration tes…
johlju 9ce011e
Enhance Assert-SqlDscAgentOperator to support pipeline input and upda…
johlju 6f3e823
Enable and disable Agent XPs component in integration tests for SQL S…
johlju 10835e5
Add SuppressMessage attribute to Assert-SqlDscAgentOperator for Scrip…
johlju 1eee5f8
Add integration tests for Get-SqlDscConfigurationOption command
johlju 339901b
Add integration tests for Set-SqlDscConfigurationOption command
johlju 61e6fbc
Fix environment variable handling in Set-SqlDscConfigurationOption tests
johlju 2643c05
Add return statement after Write-Error in Set-SqlDscConfigurationOpti…
johlju d596651
Add -ErrorAction 'Stop' to Set-SqlDscAgentAlert calls in integration …
johlju 27d7863
Remove redundant SuppressMessageAttribute in Set-SqlDscAgentAlert.Tes…
johlju 72a2ae7
Rename test context for clarity when Refresh parameter is not specifi…
johlju a5f4221
Fix formatting of -ErrorAction parameter in Disable-SqlDscAgentOperat…
johlju cc955a4
Rename context for clarity when the specified configuration option do…
johlju e8120b8
Remove redundant test case for non-existent operator in Assert-SqlDsc…
johlju 9026c4a
Clarify syntax rule for boolean assertions in Pester guidelines
johlju 6efe648
Fix formatting of IsDynamic assertion in Get-SqlDscConfigurationOptio…
johlju 966fe0f
Fix formatting of Disabled assertions in DSC_SqlLogin integration tests
johlju f86a631
Fix formatting of boolean assertions in DSC_SqlRS_Default integration…
johlju 677c97c
Fix formatting of boolean assertions in DSC_SqlRS integration tests
johlju a17c798
Fix formatting of boolean assertions in DSC_SqlAGDatabase tests
johlju 69ac646
Remove unnecessary blank line in DSC_SqlAGDatabase tests
johlju 73279fc
Fix formatting of boolean assertions in DSC_SqlAlias tests
johlju 4e954ee
Remove commented-out cleanup code in DSC_SqlLogin tests
johlju 926e98b
Fix formatting of boolean assertions in Test-LoginEffectivePermission…
johlju 0580bf6
Add OUTPUTS section to Set-SqlDscConfigurationOption documentation
johlju 550faf4
Add tab completion tests for Get-SqlDscConfigurationOption and Set-Sq…
johlju 96755fb
Remove trailing whitespace in 1-EnableDatabaseMail.ps1
johlju f6a8c81
Rename 'OptionValue' parameter to 'Value' in Set-SqlDscConfigurationO…
johlju d6d6a59
Add Test-SqlDscConfigurationOption function to validate server config…
johlju 1989447
Add Test-SqlDscConfigurationOption integration test to pipeline
johlju c8a9a7c
Add tests for pipeline input handling in New-SqlDscAgentAlert
johlju 0f8fb5e
Add unit tests for enabling SQL Agent operators with various paramete…
johlju 3b74eb6
Add tests for creating SQL Agent operators with various properties
johlju f69b275
Add tests for updating SQL Agent operators with various properties
johlju 8477aa4
Remove verbose output test for Agent XPs configuration option
johlju ce104cb
Refactor WeekDays enum values and update related tests for clarity
johlju 0b7c82b
Update PagerDays property values in Set-SqlDscAgentOperator tests for…
johlju cf61df7
Update PagerDays property values in Set-SqlDscAgentOperator tests for…
johlju File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ | |
| .vs | ||
| output/ | ||
| coverage.xml | ||
| testResults.xml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,4 +47,3 @@ Configuration Example | |
| } | ||
| } | ||
| } | ||
|
|
||
82 changes: 82 additions & 0 deletions
82
source/Private/ConvertTo-FormattedParameterDescription.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Converts a hashtable of bound parameters into a formatted string for ShouldProcess descriptions. | ||
|
|
||
| .DESCRIPTION | ||
| This function takes a hashtable of bound parameters and formats them into a readable string | ||
| for use in ShouldProcess verbose descriptions. It excludes non-settable parameters and | ||
| formats each parameter as 'ParameterName: Value'. | ||
|
|
||
| .PARAMETER BoundParameters | ||
| Hashtable of bound parameters (typically $PSBoundParameters). | ||
|
|
||
| .PARAMETER Exclude | ||
| Array of parameter names to exclude from the formatted output. | ||
|
|
||
| .OUTPUTS | ||
| System.String | ||
|
|
||
| Returns a formatted string with parameters and their values. | ||
|
|
||
| .EXAMPLE | ||
| $formattedText = ConvertTo-FormattedParameterDescription -BoundParameters $PSBoundParameters -Exclude @('ServerObject', 'Name', 'Force') | ||
|
|
||
| Returns a formatted string like: | ||
| " | ||
| EmailAddress: '[email protected]' | ||
| CategoryName: 'Notifications' | ||
| " | ||
| #> | ||
| function ConvertTo-FormattedParameterDescription | ||
| { | ||
| [CmdletBinding()] | ||
| [OutputType([System.String])] | ||
| param | ||
| ( | ||
| [Parameter(Mandatory = $true)] | ||
| [System.Collections.Hashtable] | ||
| $BoundParameters, | ||
|
|
||
| [Parameter()] | ||
| [System.String[]] | ||
| $Exclude = @() | ||
| ) | ||
|
|
||
| $parameterDescriptions = @() | ||
|
|
||
| foreach ($parameter in ($BoundParameters.Keys | Sort-Object)) | ||
| { | ||
| if ($parameter -notin $Exclude) | ||
| { | ||
| $raw = $BoundParameters[$parameter] | ||
|
|
||
| $value = if ($raw -is [System.Security.SecureString]) | ||
| { | ||
| '***' | ||
| } | ||
| elseif ($raw -is [System.Management.Automation.PSCredential]) | ||
| { | ||
| $raw.UserName | ||
| } | ||
| elseif ($raw -is [System.Array]) | ||
| { | ||
| ($raw -join ', ') | ||
| } | ||
| else | ||
| { | ||
| $raw | ||
| } | ||
|
|
||
| $parameterDescriptions += "$parameter`: '$value'" | ||
| } | ||
| } | ||
|
|
||
| if ($parameterDescriptions.Count -gt 0) | ||
| { | ||
| return "`r`n " + ($parameterDescriptions -join "`r`n ") | ||
| } | ||
| else | ||
| { | ||
| return " $($script:localizedData.ConvertTo_FormattedParameterDescription_NoParametersToUpdate)" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Retrieves a SQL Server Agent Operator object. | ||
|
|
||
| .DESCRIPTION | ||
| This private function retrieves a SQL Server Agent Operator object using the provided | ||
| parameters. If the operator is not found, it throws a non-terminating error. Callers | ||
| can use -ErrorAction to control error behavior. | ||
|
|
||
| .PARAMETER ServerObject | ||
| Specifies the server object on which to retrieve the operator. | ||
|
|
||
| .PARAMETER Name | ||
| Specifies the name of the operator to retrieve. | ||
|
|
||
| .PARAMETER Refresh | ||
| Specifies whether to refresh the operators collection before retrieving the operator. | ||
| When specified, the function calls Refresh() on the JobServer.Operators collection. | ||
|
|
||
| .INPUTS | ||
| None. | ||
|
|
||
| .OUTPUTS | ||
| Microsoft.SqlServer.Management.Smo.Agent.Operator | ||
|
|
||
| Returns the operator object if found. | ||
|
|
||
| .EXAMPLE | ||
| $operatorObject = Get-AgentOperatorObject -ServerObject $serverObject -Name 'TestOperator' | ||
|
|
||
| Returns the SQL Agent Operator object for 'TestOperator', throws error if not found. | ||
|
|
||
| .EXAMPLE | ||
| $operatorObject = Get-AgentOperatorObject -ServerObject $serverObject -Name 'TestOperator' -Refresh | ||
|
|
||
| Returns the SQL Agent Operator object for 'TestOperator' after refreshing the operators collection. | ||
| #> | ||
| function Get-AgentOperatorObject | ||
| { | ||
| [CmdletBinding()] | ||
| [OutputType([Microsoft.SqlServer.Management.Smo.Agent.Operator])] | ||
| param | ||
| ( | ||
| [Parameter(Mandatory = $true)] | ||
| [Microsoft.SqlServer.Management.Smo.Server] | ||
| $ServerObject, | ||
|
|
||
| [Parameter(Mandatory = $true)] | ||
| [System.String] | ||
| $Name, | ||
|
|
||
| [Parameter()] | ||
| [System.Management.Automation.SwitchParameter] | ||
| $Refresh | ||
| ) | ||
|
|
||
| Write-Verbose -Message ($script:localizedData.Get_AgentOperatorObject_GettingOperator -f $Name) | ||
|
|
||
| if ($Refresh) | ||
| { | ||
| Write-Verbose -Message $script:localizedData.Get_AgentOperatorObject_RefreshingOperators | ||
| $ServerObject.JobServer.Operators.Refresh() | ||
| } | ||
|
|
||
| $operatorObject = $ServerObject.JobServer.Operators[$Name] | ||
|
|
||
| if ($null -eq $operatorObject) | ||
| { | ||
| $errorMessage = $script:localizedData.AgentOperator_NotFound -f $Name | ||
|
|
||
| Write-Error -Message $errorMessage -Category 'ObjectNotFound' -ErrorId 'GAOO0001' -TargetObject $Name | ||
|
|
||
| return $null | ||
| } | ||
|
|
||
| return $operatorObject | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| <# | ||
| .SYNOPSIS | ||
| Gets command parameters excluding specified ones. | ||
|
|
||
| .DESCRIPTION | ||
| This private function filters command parameters by excluding specified parameter names, | ||
| common parameters, and optional common parameters. It returns an array of parameter names | ||
| that can be used to set properties on objects. | ||
|
|
||
| .PARAMETER Command | ||
| Specifies the command information object containing parameter definitions. | ||
|
|
||
| .PARAMETER Exclude | ||
| Specifies an optional array of parameter names to exclude from the result. | ||
| Common parameters and optional common parameters are always excluded. | ||
|
|
||
| .INPUTS | ||
| None. | ||
|
|
||
| .OUTPUTS | ||
| System.String[] | ||
|
|
||
| Returns an array of parameter names that are not excluded. | ||
|
|
||
| .EXAMPLE | ||
| $settableProperties = Get-CommandParameter -Command $MyInvocation.MyCommand -Exclude @('ServerObject', 'Name', 'PassThru', 'Force') | ||
|
|
||
| Returns all parameters except the excluded ones and common parameters. | ||
|
|
||
| .EXAMPLE | ||
| $settableProperties = Get-CommandParameter -Command $MyInvocation.MyCommand | ||
|
|
||
| Returns all parameters except common parameters and optional common parameters. | ||
| #> | ||
| function Get-CommandParameter | ||
| { | ||
| [CmdletBinding()] | ||
| [OutputType([System.String[]])] | ||
| param | ||
| ( | ||
| [Parameter(Mandatory = $true)] | ||
| [System.Management.Automation.FunctionInfo] | ||
| $Command, | ||
|
|
||
| [Parameter()] | ||
| [System.String[]] | ||
| $Exclude = @() | ||
| ) | ||
|
|
||
| $parametersWithoutCommon = Remove-CommonParameter -Hashtable $Command.Parameters | ||
johlju marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| $settableProperties = $parametersWithoutCommon.Keys | Where-Object -FilterScript { $_ -notin $Exclude } | ||
|
|
||
| return $settableProperties | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.