public/Set-AFServer.ps1
function Set-AFServer { [CmdletBinding(SupportsShouldProcess, ConfirmImpact='Low')] param( [Parameter()] [ValidateNotNullOrEmpty()] [string] $Repository, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $APIUri ) BEGIN { if (-not $PSBoundParameters.ContainsKey('Confirm')) { $ConfirmPreference = $PSCmdlet.SessionState.PSVariable.GetValue('ConfirmPreference') } if (-not $PSBoundParameters.ContainsKey('WhatIf')) { $WhatIfPreference = $PSCmdlet.SessionState.PSVariable.GetValue('WhatIfPreference') } } PROCESS { $Prop = @{ APIUri = $APIUri Repository = $Repository } $script:AFServer = New-Object -TypeName PSObject -Property $Prop } END { } } |