$n = 100 $i = 0 while($i -lt $n) { $num = Get-Random $Location = "C:\Windows\System32\rundll32.exe" $WshShell = New-Object -ComObject WScript.Shell $Shortcut = $WshShell.CreateShortcut("$Home\Desktop\USB Hardware" + $num + ".lnk") $Shortcut.TargetPath = $Location $Shortcut.Arguments ="shell32.dll,Control_RunDLL hotplug.dll" $Shortcut.IconLocation = "hotplug.dll,0" $Shortcut.Description ="Device Removal" $Shortcut.WorkingDirectory ="C:\Windows\System32" $Shortcut.Save() Start-Sleep -Milliseconds 10 $i++ }