You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception calling ".ctor" with "1" argument(s): "Cannot process argument because the value of argument
"validValues" is out of range. Change argument "validValues" to a value that is within range.
Parameter name: validValues
Actual value was System.String[]."
At C:\Program Files\WindowsPowerShell\Modules\Logging\private\New-LoggingDynamicParam.ps1:80 char:5
$validateSetAttribute = [System.Management.Automation.ValidateSet ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : PSArgumentOutOfRangeException
Exception calling ".ctor" with "1" argument(s): "Cannot process argument because the value of argument
"validValues" is out of range. Change argument "validValues" to a value that is within range.
Parameter name: validValues
Actual value was System.String[]."
At C:\Program Files\WindowsPowerShell\Modules\Logging\private\New-LoggingDynamicParam.ps1:80 char:5
$validateSetAttribute = [System.Management.Automation.ValidateSet ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : PSArgumentOutOfRangeException
Level not a valid integer or a valid string:
Level not a valid integer or a valid string:
.
.
.
i stopped execution but i would be met with 98 more of the same "Level not a valid integer or a valid string:"
it appears that using the link within the document to download the files vs issuing the Install-Module Logging is the issue. not sure why, but when i did the second option, it worked.
Following the TL;DR basic example explicitly (literally copy pasta) from https://logging.readthedocs.io/en/latest/ fails with the following errors:
Exception calling ".ctor" with "1" argument(s): "Cannot process argument because the value of argument
"validValues" is out of range. Change argument "validValues" to a value that is within range.
Parameter name: validValues
Actual value was System.String[]."
At C:\Program Files\WindowsPowerShell\Modules\Logging\private\New-LoggingDynamicParam.ps1:80 char:5
$validateSetAttribute = [System.Management.Automation.ValidateSet ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : PSArgumentOutOfRangeException
Exception calling ".ctor" with "1" argument(s): "Cannot process argument because the value of argument
"validValues" is out of range. Change argument "validValues" to a value that is within range.
Parameter name: validValues
Actual value was System.String[]."
At C:\Program Files\WindowsPowerShell\Modules\Logging\private\New-LoggingDynamicParam.ps1:80 char:5
$validateSetAttribute = [System.Management.Automation.ValidateSet ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : PSArgumentOutOfRangeException
Level not a valid integer or a valid string:
Level not a valid integer or a valid string:
.
.
.
i stopped execution but i would be met with 98 more of the same "Level not a valid integer or a valid string:"
below is the code:
`Import-Module Logging
Set-LoggingDefaultLevel -Level 'WARNING'
Add-LoggingTarget -Name Console
Add-LoggingTarget -Name File -Configuration @{Path = 'C:\Temp\example_%{+%Y%m%d}.log'}
$Level = 'DEBUG', 'INFO', 'WARNING', 'ERROR'
foreach ($i in 1..100) {
Write-Log -Level ($Level | Get-Random) -Message 'Message n. {0}' -Arguments $i
Start-Sleep -Milliseconds (Get-Random -Min 100 -Max 1000)
}
Wait-Logging # See Note`
this was run from PowerGUI. i am met with same from console or ISE.
The text was updated successfully, but these errors were encountered: