public/Get-Passwords.ps1
function Get-Passwords { [cmdletbinding(SupportsShouldProcess=$True)] param ( [Parameter()] [int]$Quantity ) $PasswordFile = "$env:USERPROFILE\Passwords.txt" Write-Host "Password text file is here $PasswordFile" -ForegroundColor Green if (test-path $PasswordFile) { Remove-Item $PasswordFile } $counter = 0 1..$Quantity | ForEach-Object { $counter++ Write-Progress -Activity 'Generating Passwords' -CurrentOperation "Password $_" -PercentComplete (($counter / $Quantity) * 100) Invoke-WebRequest http://www.dinopass.com/password/simple | Select-Object Content -ExpandProperty Content } | Out-File $PasswordFile -Append Start-Process notepad.exe -ArgumentList $PasswordFile } |