Repair-PowerShellOutputRedirectionBug
SYNOPSIS
Fix for PS2/3
SYNTAX
Repair-PowerShellOutputRedirectionBug [<CommonParameters>]
DESCRIPTION
PowerShell v2/3 caches the output stream. Then it throws errors due to the FileStream not being what is expected. Fixes "The OS handle's position is not what FileStream expected. Do not use a handle simultaneously in one FileStream and in Win32 code or another FileStream."
EXAMPLES
EXAMPLE 1
Repair-PowerShellOutputRedirectionBug #Only for PSVersion below PS4
PARAMETERS
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.