This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################## | |
## | |
## Invoke-WindowsApi.ps1 | |
## | |
## Invoke a native Windows API call that takes and returns simple data types. | |
## | |
## ie: | |
## | |
## | |
## Prepare the parameter types and parameters for the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script should be dot-sourced or copied and pasted into the interpreter. | |
# This script reproduces a problem with PowerShell v4 when KB3000850 is installed, and with PowerShell v5. | |
# It causes the interpreter to freeze / deadlock / spinlock / something that causes it to be unresponsive with high CPU | |
# See also: https://gist.github.com/anonymous/572f42ba0ea7eec4f721#file-psclass_repro_reduced11-ps1 | |
function __PSClass-InvokeScript($class, $script, $object) {} | |
function __PSClass-InvokePropertyMethod($Class, $PropertyType, $PropertyName, $instance) { | |
# Interestingly, if you comment-out the following line, the script exhibits the high CPU behavior but does *eventually* complete! |