From 4c802c13646b23ccb85fd4d7d7c043a63c0c150b Mon Sep 17 00:00:00 2001 From: Maurice MJ de Jong Date: Sun, 12 Apr 2020 17:38:35 +0200 Subject: [PATCH 1/6] Implemented Resolve-ProductState and Improved pramaters of Test-IsProductEnabled --- src/Public/Resolve-ProductState.ps1 | 46 ++++++++++++++++++++++++++++ src/Public/Test-IsProductEnabled.ps1 | 5 +-- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/Public/Resolve-ProductState.ps1 diff --git a/src/Public/Resolve-ProductState.ps1 b/src/Public/Resolve-ProductState.ps1 new file mode 100644 index 0000000..abc3010 --- /dev/null +++ b/src/Public/Resolve-ProductState.ps1 @@ -0,0 +1,46 @@ +<# +.SYNOPSIS + Resolves several statuses of a product object. +.DESCRIPTION + Resolves several statuses of a product object. If this function is be used + in a pipeline it will add properties to a product object. These properties reflect + several statuses that a product can relect using the State DWORD using bitfields. + Extracting these can be challenging and this function will help testing these values. +.EXAMPLE + PS C:\> Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct | Resolve-Productstate + Will result in: + +.PARAMETER ProductState + The value (DWORD) containing the bitflags. +.PARAMETER Products + PSObject containing object array of Microsoft.Management.Infrastructure.CimInstance#ROOT/SecurityCenter2/AntiVirusProduct +.OUTPUTS + Output (if any) +.NOTES + This function utilizes Test-IsProductEnabled, ... To enrich information on State. +#> +function Resolve-ProductState { + [CmdletBinding()] + param ( + # This parameter can be passed from pipeline and can contain and array of collections that contain State or productstate members + [Parameter(ValueFromPipeline)] + [Microsoft.Management.Infrastructure.CimInstance[]] + $Products, + # Product State contains a value (DWORD) that contains multiple bitflags and we use the productState flag (0000F000) + [Parameter(Mandatory, Position = 0, ValueFromPipelineByPropertyName, HelpMessage = "The value (DWORD) containing the bitflags.")] + [Alias("STATE")] + [UInt32]$ProductState + ) + + process { + if ($Products -is [array]) { + If ($Products.Count -gt 0) { + If (Get-Member -inputobject $Products[0] -name "productState" -Membertype Properties) { + foreach ($item in $Products) { + $item | Add-Member -NotePropertyName Enabled -NotePropertyValue $(Test-IsProductEnabled -ProductState $item.productState) + } + } + } + } + } +} \ No newline at end of file diff --git a/src/Public/Test-IsProductEnabled.ps1 b/src/Public/Test-IsProductEnabled.ps1 index e0ed60e..f11a656 100644 --- a/src/Public/Test-IsProductEnabled.ps1 +++ b/src/Public/Test-IsProductEnabled.ps1 @@ -22,8 +22,9 @@ function Test-IsProductEnabled { [CmdletBinding()] param ( # Product State contains a value (DWORD) that contains multiple bitflags and we use the productState flag (0000F000) - [Parameter(Mandatory, Position=0, ValueFromPipeline, HelpMessage="The value (DWORD) containing the bitflags.")] - [Int32]$ProductState + [Parameter(Mandatory, Position = 0, ValueFromPipelineByPropertyName, HelpMessage = "The value (DWORD) containing the bitflags.")] + [Alias("STATE")] + [UInt32]$ProductState ) $ProductEnabled = 0x1000 $ProductStateMask = 0x0000f000 From 1410bb4378f4f782ee620dbb43f705ea3fc34573 Mon Sep 17 00:00:00 2001 From: Maurice MJ de Jong Date: Sun, 12 Apr 2020 17:57:14 +0200 Subject: [PATCH 2/6] Updated module manifest --- src/wrt.helpers.psd1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wrt.helpers.psd1 b/src/wrt.helpers.psd1 index 778a7a3..7ef19eb 100644 --- a/src/wrt.helpers.psd1 +++ b/src/wrt.helpers.psd1 @@ -13,7 +13,7 @@ # Version number of this module. - ModuleVersion = '1.0.3' + ModuleVersion = '1.0.8' # Supported PSEditions CompatiblePSEditions = 'Core', 'Desktop' @@ -80,7 +80,10 @@ 'Deploy-CompressedFile', 'Deploy-File', 'Find-File', + 'Remove-RegistryKey', 'Remove-RegistryValue', + 'Resolve-ProductState', + 'Search-Registry', 'Send-MessageToLocalUsers', 'Send-ToLogAnalytics', 'Test-IsProductEnabled', @@ -111,7 +114,8 @@ # Tags applied to this module. These help with module discovery in online galleries. Tags = @( 'helper', - 'productstate' + 'productstate', + 'registry' ) # A URL to the license for this module. @@ -124,7 +128,7 @@ # IconUri = '' # ReleaseNotes of this module - ReleaseNotes = 'First release' + ReleaseNotes = 'Added Resolve-ProductState' } # End of PSData hashtable From bbed22bca889c2909673d595c352b99387e1cc99 Mon Sep 17 00:00:00 2001 From: Maurice MJ de Jong Date: Sun, 12 Apr 2020 23:14:58 +0200 Subject: [PATCH 3/6] Trying different methods --- src/Public/Add-ProductStates.ps1 | 138 ++++++++++++++++++++++++++++ src/Public/Resolve-ProductState.ps1 | 46 ---------- src/wrt.helpers.psd1 | 2 +- 3 files changed, 139 insertions(+), 47 deletions(-) create mode 100644 src/Public/Add-ProductStates.ps1 delete mode 100644 src/Public/Resolve-ProductState.ps1 diff --git a/src/Public/Add-ProductStates.ps1 b/src/Public/Add-ProductStates.ps1 new file mode 100644 index 0000000..aed6977 --- /dev/null +++ b/src/Public/Add-ProductStates.ps1 @@ -0,0 +1,138 @@ +<# +.SYNOPSIS + Adds statuses to a product PSObject. + +.DESCRIPTION + Adds statuses to a product PSObject. If this function is used + in a command pipeline it will add properties to the resulting PSObject containing boolean properties. These properties reflect + status of Product Enablement and if it is updated. These values are calculated using the State DWORD using bitfields. + +.PARAMETER ProductState + The value (DWORD) containing the bitflags. + +.PARAMETER Products + PSObject containing object array of Microsoft.Management.Infrastructure.CimInstance#ROOT/SecurityCenter2/AntiVirusProduct + +.EXAMPLE + PS C:\Users\maurice> Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct | Add-ProductStates + + enabled : True + displayName : Trend Micro Antivirus+ + instanceGuid : {AFEE279F-FAE7-BAEE-3A88-4BF7277B8551} + pathToSignedProductExe : C:\Program Files\Trend Micro\Titanium\TmWscSvc\wschandler.exe + pathToSignedReportingExe : C:\Program Files\Trend Micro\Titanium\TmWscSvc\WSCStatusController.exe + productState : 266240 + timestamp : Sun, 12 Apr 2020 15:09:56 GMT + PSComputerName : + + enabled : True + displayName : Sophos Home + instanceGuid : {FFADE7EA-DC92-4602-D6B2-626CD3450A0F} + pathToSignedProductExe : C:\Program Files (x86)\Sophos\Sophos Anti-Virus\WSCClient.exe + pathToSignedReportingExe : C:\Program Files (x86)\Sophos\Sophos Anti-Virus\WSCClient.exe + productState : 331776 + timestamp : Sun, 12 Apr 2020 15:18:39 GMT + PSComputerName : + + enabled : False + displayName : Windows Defender + instanceGuid : {D68DDC3A-831F-4fae-9E44-DA132C1ACF46} + pathToSignedProductExe : windowsdefender:// + pathToSignedReportingExe : %ProgramFiles%\Windows Defender\MsMpeng.exe + productState : 393472 + timestamp : Sun, 12 Apr 2020 15:08:57 GMT + PSComputerName : + +.EXAMPLE + PS C:\Users\maurice> $products = Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct + PS C:\Users\maurice> Add-ProductStates -Products $products + + enabled : True + displayName : Trend Micro Antivirus+ + instanceGuid : {AFEE279F-FAE7-BAEE-3A88-4BF7277B8551} + pathToSignedProductExe : C:\Program Files\Trend Micro\Titanium\TmWscSvc\wschandler.exe + pathToSignedReportingExe : C:\Program Files\Trend Micro\Titanium\TmWscSvc\WSCStatusController.exe + productState : 266240 + timestamp : Sun, 12 Apr 2020 15:09:56 GMT + PSComputerName : + + enabled : True + displayName : Sophos Home + instanceGuid : {FFADE7EA-DC92-4602-D6B2-626CD3450A0F} + pathToSignedProductExe : C:\Program Files (x86)\Sophos\Sophos Anti-Virus\WSCClient.exe + pathToSignedReportingExe : C:\Program Files (x86)\Sophos\Sophos Anti-Virus\WSCClient.exe + productState : 331776 + timestamp : Sun, 12 Apr 2020 15:18:39 GMT + PSComputerName : + + enabled : False + displayName : Windows Defender + instanceGuid : {D68DDC3A-831F-4fae-9E44-DA132C1ACF46} + pathToSignedProductExe : windowsdefender:// + pathToSignedReportingExe : %ProgramFiles%\Windows Defender\MsMpeng.exe + productState : 393472 + timestamp : Sun, 12 Apr 2020 15:08:57 GMT + PSComputerName : + +.EXAMPLE + PS C:\Users\maurice> (Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct)[0].productState | Add-ProductStates + + enabled : True + +.EXAMPLE + PS C:\Users\maurice> $prodState = (Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct)[0].productState + PS C:\Users\maurice> Add-ProductStates -ProductState $prodState + + enabled : True + +.NOTES + This function utilizes Test-IsProductEnabled, ... To enrich information on State. +#> +function Add-ProductStates { + [CmdletBinding()] + param ( + # This parameter can be passed from pipeline and can contain and array of collections that contain State or productstate members + [Parameter(ValueFromPipeline)] + [Microsoft.Management.Infrastructure.CimInstance[]] + $Products, + # Product State contains a value (DWORD) that contains multiple bitflags and we use the productState flag (0000F000) + [Parameter(Position = 0, ValueFromPipelineByPropertyName, ValueFromPipeline, HelpMessage = "The value (DWORD) containing the bitflags.")] + [Alias("STATE")] + [UInt32]$ProductState + ) + + begin { + $results = $null + } + + process { + If ($Products -is [array]) { + If ($Products.Count -gt 0) { + If (Get-Member -inputobject $Products[0] -name "productState" -Membertype Properties) { + $results += $Products.PSObject.Copy() + foreach ($item in $Products) { + If($results.Where({$_.instanceGuid -eq $item.instanceGuid}).Properties.name -notmatch "enabled") { + $results.Where({$_.instanceGuid -eq $item.instanceGuid}) | Add-Member -NotePropertyName enabled -NotePropertyValue $(Test-IsProductEnabled -ProductState $item.productState) + } + else { + Write-Error 'Could not enabled property it already exists...' + } + } + } + } + } + If ($ProductState -and (-not $Products)) { + If($results.Properties.name -notmatch "enabled") { + $results += New-Object PSObject -Property @{ + enabled = $(Test-IsProductEnabled -ProductState $ProductState) + } + } + } + } + + end { + If($results) { + return $results + } + } +} \ No newline at end of file diff --git a/src/Public/Resolve-ProductState.ps1 b/src/Public/Resolve-ProductState.ps1 deleted file mode 100644 index abc3010..0000000 --- a/src/Public/Resolve-ProductState.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -<# -.SYNOPSIS - Resolves several statuses of a product object. -.DESCRIPTION - Resolves several statuses of a product object. If this function is be used - in a pipeline it will add properties to a product object. These properties reflect - several statuses that a product can relect using the State DWORD using bitfields. - Extracting these can be challenging and this function will help testing these values. -.EXAMPLE - PS C:\> Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct | Resolve-Productstate - Will result in: - -.PARAMETER ProductState - The value (DWORD) containing the bitflags. -.PARAMETER Products - PSObject containing object array of Microsoft.Management.Infrastructure.CimInstance#ROOT/SecurityCenter2/AntiVirusProduct -.OUTPUTS - Output (if any) -.NOTES - This function utilizes Test-IsProductEnabled, ... To enrich information on State. -#> -function Resolve-ProductState { - [CmdletBinding()] - param ( - # This parameter can be passed from pipeline and can contain and array of collections that contain State or productstate members - [Parameter(ValueFromPipeline)] - [Microsoft.Management.Infrastructure.CimInstance[]] - $Products, - # Product State contains a value (DWORD) that contains multiple bitflags and we use the productState flag (0000F000) - [Parameter(Mandatory, Position = 0, ValueFromPipelineByPropertyName, HelpMessage = "The value (DWORD) containing the bitflags.")] - [Alias("STATE")] - [UInt32]$ProductState - ) - - process { - if ($Products -is [array]) { - If ($Products.Count -gt 0) { - If (Get-Member -inputobject $Products[0] -name "productState" -Membertype Properties) { - foreach ($item in $Products) { - $item | Add-Member -NotePropertyName Enabled -NotePropertyValue $(Test-IsProductEnabled -ProductState $item.productState) - } - } - } - } - } -} \ No newline at end of file diff --git a/src/wrt.helpers.psd1 b/src/wrt.helpers.psd1 index 7ef19eb..7ff2e2f 100644 --- a/src/wrt.helpers.psd1 +++ b/src/wrt.helpers.psd1 @@ -77,12 +77,12 @@ # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = @( + 'Add-ProductStates' 'Deploy-CompressedFile', 'Deploy-File', 'Find-File', 'Remove-RegistryKey', 'Remove-RegistryValue', - 'Resolve-ProductState', 'Search-Registry', 'Send-MessageToLocalUsers', 'Send-ToLogAnalytics', From 1bfb5e671fd9e268e04cd16683dabfeb9b70fd03 Mon Sep 17 00:00:00 2001 From: Maurice MJ de Jong Date: Mon, 13 Apr 2020 11:02:29 +0200 Subject: [PATCH 4/6] Added enums for resolving State from ROOT/SecurityCenter2/AntivirusProduct --- src/enums/ProductFlags.ps1 | 6 ++++++ src/enums/ProductOwner.ps1 | 5 +++++ src/enums/ProductState.ps1 | 7 +++++++ src/enums/SignatureStatus.ps1 | 5 +++++ 4 files changed, 23 insertions(+) create mode 100644 src/enums/ProductFlags.ps1 create mode 100644 src/enums/ProductOwner.ps1 create mode 100644 src/enums/ProductState.ps1 create mode 100644 src/enums/SignatureStatus.ps1 diff --git a/src/enums/ProductFlags.ps1 b/src/enums/ProductFlags.ps1 new file mode 100644 index 0000000..1d27b87 --- /dev/null +++ b/src/enums/ProductFlags.ps1 @@ -0,0 +1,6 @@ +[Flags()] enum ProductFlags +{ + ProductStatus = 0x000000F0 + Owner = 0x00000F00 + ProductState = 0x0000F000 +} \ No newline at end of file diff --git a/src/enums/ProductOwner.ps1 b/src/enums/ProductOwner.ps1 new file mode 100644 index 0000000..6fbebf2 --- /dev/null +++ b/src/enums/ProductOwner.ps1 @@ -0,0 +1,5 @@ +[Flags()] enum ProductOwner +{ + NonMs = 0x000 + Windows = 0x100 +} \ No newline at end of file diff --git a/src/enums/ProductState.ps1 b/src/enums/ProductState.ps1 new file mode 100644 index 0000000..62959d0 --- /dev/null +++ b/src/enums/ProductState.ps1 @@ -0,0 +1,7 @@ +[Flags()] enum productState +{ + Off = 0x0000 + Enabled = 0x1000 + Snoozed = 0x2000 + Expired = 0x3000 +} \ No newline at end of file diff --git a/src/enums/SignatureStatus.ps1 b/src/enums/SignatureStatus.ps1 new file mode 100644 index 0000000..d70bdd2 --- /dev/null +++ b/src/enums/SignatureStatus.ps1 @@ -0,0 +1,5 @@ +[Flags()] enum signatureStatus +{ + UpToDate = 0x10 + OutOfDate = 0x00 +} \ No newline at end of file From 5b4b42e7cc92a7444f17e7affe7b22168280c432 Mon Sep 17 00:00:00 2001 From: Maurice MJ de Jong Date: Mon, 13 Apr 2020 11:59:46 +0200 Subject: [PATCH 5/6] Added examples renamed functions much more functionality... --- src/Public/Add-ProductStates.ps1 | 19 ++++++++--- src/Public/Test-IsProductEnabled.ps1 | 47 -------------------------- src/Public/Test-IsProductStateOn.ps1 | 50 ++++++++++++++++++++++++++++ src/enums/ProductFlags.ps1 | 6 ++-- src/enums/ProductState.ps1 | 4 +-- src/enums/SignatureStatus.ps1 | 6 ++-- 6 files changed, 72 insertions(+), 60 deletions(-) delete mode 100644 src/Public/Test-IsProductEnabled.ps1 create mode 100644 src/Public/Test-IsProductStateOn.ps1 diff --git a/src/Public/Add-ProductStates.ps1 b/src/Public/Add-ProductStates.ps1 index aed6977..dea552f 100644 --- a/src/Public/Add-ProductStates.ps1 +++ b/src/Public/Add-ProductStates.ps1 @@ -1,3 +1,4 @@ +function Add-ProductStates { <# .SYNOPSIS Adds statuses to a product PSObject. @@ -88,7 +89,6 @@ .NOTES This function utilizes Test-IsProductEnabled, ... To enrich information on State. #> -function Add-ProductStates { [CmdletBinding()] param ( # This parameter can be passed from pipeline and can contain and array of collections that contain State or productstate members @@ -111,11 +111,19 @@ function Add-ProductStates { If (Get-Member -inputobject $Products[0] -name "productState" -Membertype Properties) { $results += $Products.PSObject.Copy() foreach ($item in $Products) { - If($results.Where({$_.instanceGuid -eq $item.instanceGuid}).Properties.name -notmatch "enabled") { - $results.Where({$_.instanceGuid -eq $item.instanceGuid}) | Add-Member -NotePropertyName enabled -NotePropertyValue $(Test-IsProductEnabled -ProductState $item.productState) + If($results.Where({$_.instanceGuid -eq $item.instanceGuid}).Properties.name -notmatch "state") { + $results.Where({$_.instanceGuid -eq $item.instanceGuid}) | + Add-Member -NotePropertyName state -NotePropertyValue $([ProductState]($item.productState -band [ProductFlags]::ProductState)) + } + else { + Write-Error 'Could not add state property it already exists...' + } + If($results.Where({$_.instanceGuid -eq $item.instanceGuid}).Properties.name -notmatch "signatureStatus") { + $results.Where({$_.instanceGuid -eq $item.instanceGuid}) | + Add-Member -NotePropertyName signatureStatus -NotePropertyValue $([SignatureStatus]($item.productState -band [ProductFlags]::SignatureStatus)) } else { - Write-Error 'Could not enabled property it already exists...' + Write-Error 'Could not add signatureStatus property it already exists...' } } } @@ -124,7 +132,8 @@ function Add-ProductStates { If ($ProductState -and (-not $Products)) { If($results.Properties.name -notmatch "enabled") { $results += New-Object PSObject -Property @{ - enabled = $(Test-IsProductEnabled -ProductState $ProductState) + state = $([ProductState]($item.productState -band [ProductFlags]::ProductState)) + signatureStatus = $([SignatureStatus]($item.productState -band [ProductFlags]::SignatureStatus)) } } } diff --git a/src/Public/Test-IsProductEnabled.ps1 b/src/Public/Test-IsProductEnabled.ps1 deleted file mode 100644 index f11a656..0000000 --- a/src/Public/Test-IsProductEnabled.ps1 +++ /dev/null @@ -1,47 +0,0 @@ -function Test-IsProductEnabled { - <# - .SYNOPSIS - Tests if given product state has product state flag enabled - .DESCRIPTION - Registry, WMI and other propties may contain a DWORD value or data object that represents the state of the corresponding product. - Specific enablement of the product is set to a bit in this DWORD, it can be challenging to gather the exact value of the flag. - This function will return true if the flag is set, meaning it is enabled. - .PARAMETER ProductState - The value (DWORD) containing the bitflags. - .EXAMPLE - PS C:\> Test-IsProductEnabled -ProductState 393472 - $false - This example shows basic functionality - .OUTPUTS - Bool - .NOTES - This function was build to resolve the state of a Antivirus Provider registered in Security Center. - Using this function it is possible to read which provider is enabled or not. - Other states are Snoozed which can be tested with Test-ProductIsSnoozed - #> - [CmdletBinding()] - param ( - # Product State contains a value (DWORD) that contains multiple bitflags and we use the productState flag (0000F000) - [Parameter(Mandatory, Position = 0, ValueFromPipelineByPropertyName, HelpMessage = "The value (DWORD) containing the bitflags.")] - [Alias("STATE")] - [UInt32]$ProductState - ) - $ProductEnabled = 0x1000 - $ProductStateMask = 0x0000f000 - - try - { - if( $($ProductEnabled -and $($ProductState -band $ProductStateMask) ) ) - { - return $true - } - else - { - return $false - } - } - catch - { - return $false - } -} \ No newline at end of file diff --git a/src/Public/Test-IsProductStateOn.ps1 b/src/Public/Test-IsProductStateOn.ps1 new file mode 100644 index 0000000..fff3cfb --- /dev/null +++ b/src/Public/Test-IsProductStateOn.ps1 @@ -0,0 +1,50 @@ +function Test-IsProductStateOn { + <# + .SYNOPSIS + Tests if given product state has product state flag to On + .DESCRIPTION + Registry, WMI and other properties may contain a DWORD value or data object that represents the state of the corresponding product. + Specific state of the product is set to a bit in this DWORD, these states can be optained using bitwise operations. + This function will return true if the flag for product state is set to on, meaning this product is enabled. + .PARAMETER ProductState + The value (DWORD) containing the bitflags. + .EXAMPLE + PS C:\> Test-IsProductStateOn -ProductState 393472 + $false + This example shows basic functionality + .OUTPUTS + Bool + .NOTES + This function was build to resolve the state of a Antivirus Provider registered in Security Center. + Using this function it is possible to read which product is set to On or not. + Other states are Off, Snoozed and Expired which can be resolved by using the enums provided in this module. + Example: Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct | Where-Object {($_.productState -band [ProductFlags]::ProductState) -eq [ProductState]::Off} + Will list all products that are disabled. + Use Add-ProductStates to return the actual state or cast the value using the stateflag + $prod = Get-CimInstance -Namespace root/SecurityCenter2 -ClassName AntivirusProduct + [SignatureStatus]($prod[0].productState -band [ProductFlags]::SignatureStatus) + #> + [CmdletBinding()] + param ( + # Product State contains a value (DWORD) that contains multiple bitflags and we use the productState flag (0000F000) + [Parameter(Mandatory, Position = 0, ValueFromPipelineByPropertyName, HelpMessage = "The value (DWORD) containing the bitflags.")] + [Alias("STATE")] + [UInt32]$ProductState + ) + + try + { + if( $([ProductState]::On -and $($ProductState -band [ProductFlags]::ProductState) ) ) + { + return $true + } + else + { + return $false + } + } + catch + { + return $false + } +} \ No newline at end of file diff --git a/src/enums/ProductFlags.ps1 b/src/enums/ProductFlags.ps1 index 1d27b87..11aa6e8 100644 --- a/src/enums/ProductFlags.ps1 +++ b/src/enums/ProductFlags.ps1 @@ -1,6 +1,6 @@ [Flags()] enum ProductFlags { - ProductStatus = 0x000000F0 - Owner = 0x00000F00 - ProductState = 0x0000F000 + SignatureStatus = 0x000000F0 + ProductOwner = 0x00000F00 + ProductState = 0x0000F000 } \ No newline at end of file diff --git a/src/enums/ProductState.ps1 b/src/enums/ProductState.ps1 index 62959d0..5c47b3c 100644 --- a/src/enums/ProductState.ps1 +++ b/src/enums/ProductState.ps1 @@ -1,7 +1,7 @@ -[Flags()] enum productState +[Flags()] enum ProductState { Off = 0x0000 - Enabled = 0x1000 + On = 0x1000 Snoozed = 0x2000 Expired = 0x3000 } \ No newline at end of file diff --git a/src/enums/SignatureStatus.ps1 b/src/enums/SignatureStatus.ps1 index d70bdd2..dacf041 100644 --- a/src/enums/SignatureStatus.ps1 +++ b/src/enums/SignatureStatus.ps1 @@ -1,5 +1,5 @@ -[Flags()] enum signatureStatus +[Flags()] enum SignatureStatus { - UpToDate = 0x10 - OutOfDate = 0x00 + UpToDate = 0x00 + OutOfDate = 0x10 } \ No newline at end of file From 218829ae23c1f92c463cf17569296c890d5e94ee Mon Sep 17 00:00:00 2001 From: Maurice MJ de Jong Date: Mon, 13 Apr 2020 15:08:19 +0200 Subject: [PATCH 6/6] Updte example --- src/Public/Test-IsProductStateOn.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Public/Test-IsProductStateOn.ps1 b/src/Public/Test-IsProductStateOn.ps1 index fff3cfb..0f5922c 100644 --- a/src/Public/Test-IsProductStateOn.ps1 +++ b/src/Public/Test-IsProductStateOn.ps1 @@ -10,7 +10,7 @@ function Test-IsProductStateOn { The value (DWORD) containing the bitflags. .EXAMPLE PS C:\> Test-IsProductStateOn -ProductState 393472 - $false + False This example shows basic functionality .OUTPUTS Bool