Found something here:
$counter = 0
while(!$Host.UI.RawUI.KeyAvailable -and ($counter++ -lt 600))
{
[Threading.Thread]::Sleep( 1000 )
}
More Related Contents:
- PowerShell says “execution of scripts is disabled on this system.”
- Create objects with custom properties containing derived filesystem path information and export them to a CSV – calculated properties
- What’s the best way to determine the location of the current PowerShell script?
- Using a Variable (PowerShell) inside of a command
- Changing PowerShell’s default output encoding to UTF-8
- PowerShell outputting array items when interpolating within double quotes
- PSCustomObject to Hashtable
- Using Get-ChildItem -Exclude or -Include returns nothing
- Get remote registry value
- What’s the difference between single quote and double quote to define a string in powershell
- Catching FULL exception message
- Powershell call msbuild with nested quotation marks
- Redirection of standard and error output appending to the same log file
- Convert Unix time with PowerShell
- How can I get the file system location of a PowerShell script?
- How can I get the current PowerShell executing file?
- You cannot call a method on a null-valued expression
- How do I call the PowerShell CLI robustly, with respect to character encoding, input and output streams, quoting and escaping?
- DateTime subtraction not working in PowerShell – assignment vs. equality operator
- Loading Assemblies from NuGet Packages
- How can I run a PowerShell script with white spaces in the path from the command line?
- How to speed up Powershell Get-Childitem over UNC
- How can I start Powershell script as noprofile in Visual Studio Code
- Output file doesn’t match Write-Host
- Running CMD command in PowerShell
- How to execute a PowerShell function several times in parallel?
- notcontains not working for User objects pulled from AD Groups
- How to uninstall an app that another user installed?
- Uploading file to HTTP via Powershell
- Strange behavior for PowerShell Length after ForEach method