# Ask for confirmation Write-host "Creating $amount test files in $path" -ForegroundColor Cyan $reply = Read-Host -Prompt "Is this correct? [Y] Yes [N] No " # Check the reply and create the files: if ( $reply -match "[yY]" ) { # Create files 1..10 | ForEach-Object { $newFile = "$path\test_file_$_.txt"; New-Item $newFile } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter