Hi, soooooo....
What i basically want do is plugging in a USB, then i want to execute a PowerShell command that runs and downloads the script launcher.ps1 (i already have that part coded).
Launcher.ps1 should basically copy a file (bg.ps1) from the USB to the local machine and run it.
I cant host bg.ps1 online because it contains credentials.
Then i want to be able to unplug the USB again.
bg.ps1 should basically run multiple other scripts that are hosted online and give them the credentials as Variables.
The scripts executed by bg.ps1 should be ran in the Background and it would be the best if they could be executed and given the variables without writing the Disk.
Hope i could kinda explain what i want to do, and i hope someone can help me with that : )
Here's what i have yet (bg.ps1 is awful i think...)
https://gist.github.com/Bube787/617d7354c5ef4b58dc70abfa10193d3d
If anyone can help me, thank you very much