Hi there,
im learning PS at the moment and because my vacation is coming closer and i am the only one here interested in using and writing PS scripts im trying to simplify them.
I found a nice way including a GUI for my scripts but its not working properly yet.
Maybe you can help me out as many times before.
this is only about ease of use. The script will grow in terms of security and some other points.
Powershell
${function:RenamePC}={param(${oldname},${newname},${AdminAcc},${AdminPW})netdomrenamecomputer$oldname/newname:$Newname/userd:DOMAIN\$AdminAcc/passwordd:$AdminPW/reboot:10}Show-Command"RenamePC"It works fine.
GUI comes up and if i enter the parameters they will be copied into the function.

But after that i have to confirm that i want to execute this command (yes or no) but whatever i enter, the script won't...