Skip to content

Instantly share code, notes, and snippets.

@camusicjunkie
Created April 23, 2018 22:04
Show Gist options
  • Save camusicjunkie/294ebc9b0a9c7c6b9a6b57bdefe5eefe to your computer and use it in GitHub Desktop.
Save camusicjunkie/294ebc9b0a9c7c6b9a6b57bdefe5eefe to your computer and use it in GitHub Desktop.
function Invoke-ScanState {
[cmdletbinding(DefaultParameterSetName = 'StorePath')]
param(
[Parameter(ParameterSetName = 'StorePath',
Position = 0)]
[string] $StorePath = 'C:\Backup',
[Parameter(ParameterSetName = 'StorePath')]
[Parameter(ParameterSetName = 'Hardlink')]
[ValidateSet('Abort', 'Skip', 'DecryptCopy', 'CopyRaw', 'Hardlink')]
$Efs,
[Parameter(ParameterSetName = 'StorePath')]
[Parameter(ParameterSetName = 'Hardlink',
Mandatory)]
[switch] $NoCompress
)
dynamicParam {
if ($PSBoundParameters.ContainsValue('Hardlink')) {
$params = @{
'Name' = 'Hardlink'
'ParameterSetName' = 'Hardlink'
'Mandatory' = $true
'Type' = [switch]
}
New-DynamicParameter @params
}
}
begin {
$Hardlink = $PSBoundParameters.Hardlink
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment