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
{{ message }}
This repository was archived by the owner on Jun 16, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Jun 16, 2021. It is now read-only.
Write-Verbose-Verbose:$verboseFlag"Initializing the compatibility session on host '$ComputerName'."
If $verboseFlag is needed then please change all occurrences of: [bool] $verboseFlag = $PSBoundParameters['Verbose']
to: $verboseFlag = [bool]$PSBoundParameters['Verbose']
Also getting this issue, and the suggested change of casting the value before it's assigned rather than casting the variable seems to fix it for me. There are 8 occurrences of this bug in WindowsCompatibility.psm1, with $verboseFlag, $whatIfFlag, and $confirmFlag.
Bear (@Medve01) I see you've submitted a PR for the $verboseFlag instances, but not the $whatIfFlag or $confirmFlag ones. I think it's cleaner to go with what theDonOfBran suggested and do $verboseFlag = [bool]$PSBoundParameters['Verbose'] rather than defaulting to $false and then checking whether it exists, since if its value hasn't been instantiated yet then casting it to a bool gives it a value of $false anyway. I can't vouch for whether this fixes the bug on VSCode however.
Any updates on this one? How come you guys make it work? I got Cannot convert value "" to type "System.Boolean" error on every Push-Location and Import-WinModule without explicit -Verbose. I can contribute. But when will it be accepted with such a workflow??
Same issue here, I'm running version 7.0.3 Import-WinModule -Name WebAdministration Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, | $False, 1 or 0.'
Running with the verbose flag works Import-WinModule -Name WebAdministration -Verbose
WindowsCompatibility/WindowsCompatibility/WindowsCompatibility.psm1
Line 150 in 7b76e65
I'm not sure if Write-Verbose cmdlet use in this project requires the Verbose parameter to be set, I'd remove it if not.
WindowsCompatibility/WindowsCompatibility/WindowsCompatibility.psm1
Line 157 in 7b76e65
If $verboseFlag is needed then please change all occurrences of:
[bool] $verboseFlag = $PSBoundParameters['Verbose']to:
$verboseFlag = [bool]$PSBoundParameters['Verbose']