Functions/Get-Puppeteer_DeclareDelayFunction.ps1
<#
.SYNOPSIS This function returns the JS code snippet for declaring a function that waits for a specified amount of time. #> function Get-Puppeteer_DeclareDelayFunction { [CmdletBinding(PositionalBinding=$true)] [OutputType([String])] param () return @" // Delays for a specified number of milliseconds function delay(ms) { return new Promise(resolve => { setTimeout(resolve, ms); }); } "@ } |