I have two computers running Windows 10 Pro. I have the same PowerShell script on both of them in a .ps1 file.
On the first computer, when I right-click on the .ps1 file and select Run with PowerShell, it runs as an administrator (the PowerShell window says Administrator: PowerShell in the header). But on the second computer, it doesn't run as an administrator (the PowerShell window just says PowerShell in the header). This causes some problems with executing the script because I need to run it as an administrator.
How can I get the second computer to work like the first computer and automatically run the scripts as an administrator when Run with PowerShell is selected?