Skip to content

Instantly share code, notes, and snippets.

@Dan1el42
Last active August 27, 2015 15:29
Show Gist options
  • Select an option

  • Save Dan1el42/713e45267f43e2b042d4 to your computer and use it in GitHub Desktop.

Select an option

Save Dan1el42/713e45267f43e2b042d4 to your computer and use it in GitHub Desktop.
Bug in PowerShell v5 version of 2016 TP3
# Get-DscResource -Module TestBug | Select-Object -ExpandProperty Properties
# Un-comment the ValidateNotNullEmpty attribute to repro the bug
enum Ensure
{
Present
Absent
}
[DscResource()]
class TestBug
{
[DscProperty(Key)]
#[ValidateNotNullOrEmpty()]
[System.String]
$DriveLetter
[DscProperty(Mandatory)]
[System.String]
$Path
[DscProperty(Mandatory)]
[Ensure]
$Ensure
[void] Set()
{
}
[bool] Test ()
{
return $true
}
[TestBug] Get()
{
return $this
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment