Windows PowerShell 5.1 hangs displaying result from Invoke-WebRequest
Entering this reproducibly hangs Windows PowerShell 5.1:
$r = iwr 'https://marketplace.visualstudio.com/items?itemName=austin.code-gnu-global'
$r
Here's what one gets with Set-PSDebug -Trace 2:
> $r
DEBUG: 94+ >>>> {
DEBUG: ! CALL function '<ScriptBlock><DynamicParam>'
DEBUG: 97+ >>>> $getCommand = $executionContext.InvokeCommand.GetCmdlet(
DEBUG: ! SET $getCommand = 'Get-Command'.
DEBUG: 99+ >>>> $foreachObject = $executionContext.InvokeCommand.GetCmdlet(
DEBUG: ! SET $foreachObject = 'ForEach-Object'.
DEBUG: 101+ >>>> $whereObject = $executionContext.InvokeCommand.GetCmdlet(
DEBUG: ! SET $whereObject = 'Where-Object'.
DEBUG: 107+ >>>> $command = & $getCommand Out-Default -Type Cmdlet
DEBUG: ! SET $command = 'Out-Default'.
DEBUG: 108+ >>>> $targetParameters = @{}
DEBUG: ! SET $targetParameters = 'System.Collections.Hashtable'.
DEBUG: 109+ >>>> $PSBoundParameters.GetEnumerator() |
DEBUG: 118+ >>>> $argList = @($targetParameters.GetEnumerator() |
DEBUG: 118+ $argList = @( >>>> $targetParameters.GetEnumerator() |
DEBUG: ! SET $argList = ''.
DEBUG: 123+ >>>> $command = $null
DEBUG: ! SET $command = ''.
DEBUG: 126+ >>>> $command = & $getCommand Out-Default -Type Cmdlet `
DEBUG: ! SET $command = 'Out-Default'.
DEBUG: 134+ >>>> $dynamicParams = @($command.Parameters.GetEnumerator() |
DEBUG: 134+ $dynamicParams = @( >>>> $command.Parameters.GetEnumerator() |
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: 135+ & $whereObject >>>> { $.Value.IsDynamic })
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 135+ & $whereObject { >>>> $.Value.IsDynamic })
DEBUG: 135+ & $whereObject { $.Value.IsDynamic >>>> })
DEBUG: ! SET $dynamicParams = ''.
DEBUG: 139+ if ( >>>> $dynamicParams.Length -gt 0)
DEBUG: 154+ >>>> }
DEBUG: 13+ >>>> {
DEBUG: ! CALL function '<ScriptBlock><Begin>'
DEBUG: 19+ >>>> $foreachObject = $executionContext.InvokeCommand.GetCmdlet(
DEBUG: ! SET $foreachObject = 'ForEach-Object'.
DEBUG: 22+ >>>> $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(
DEBUG: ! SET $wrappedCmd = 'Out-Default'.
DEBUG: 28+ >>>> $targetParameters = @{}
DEBUG: ! SET $targetParameters = 'System.Collections.Hashtable'.
DEBUG: 29+ >>>> $PSBoundParameters.GetEnumerator() |
DEBUG: 38+ >>>> $newPipeline = { & $wrappedCmd @targetParameters }
DEBUG: ! SET $newPipeline = ' & $wrappedCmd @targetParameters '.
DEBUG: 39+ >>>> $finalPipeline = $newPipeline.ToString()
DEBUG: ! SET $finalPipeline = ' & $wrappedCmd @targetParameters '.
DEBUG: 43+ >>>> $steppablePipeline = [ScriptBlock]::Create(
DEBUG: ! SET $steppablePipeline = 'System.Management.Automation.SteppablePipel...'.
DEBUG: 45+ >>>> $steppablePipeline.Begin($PSCmdlet)
DEBUG: 49+ >>>> }
DEBUG: 1+ >>>> $r
DEBUG: ! CALL function '<ScriptBlock>'
DEBUG: 52+ >>>> {
DEBUG: ! CALL function '<ScriptBlock><Process>'
DEBUG: 56+ if( >>>> ($ -is [System.IO.DirectoryInfo]) -or ($ -is [System.IO.FileInfo]))
DEBUG: 62+ elseif( >>>> $ -is [System.ServiceProcess.ServiceController])
DEBUG: 68+ elseif( >>>> $ -is [Microsoft.Powershell.Commands.MatchInfo])
DEBUG: 74+ >>>> $steppablePipeline.Process($)
Moving to PS7 is not an option since I need $r.ParsedHTML
