I have a powershell script that occasionally fails on systems that aren't running it with the correct account.
What I want to do is put a check at the beginning of the script to check that the user running the script has admin rights.
In Linux bash scripts I'd use something like this:
if [ "$(id -u)" != "0" ]; then
I've run a few internet searches but I've not been able to find anything...
What is the powershell equivelant to this?
any help would be much appreciated