Skip to main content
Tweeted twitter.com/StackSecurity/status/1405586064631386115
deleted 2 characters in body
Source Link
schroeder
  • 132.1k
  • 55
  • 307
  • 348

Since the 20H2 build of Windows 10 came out, if I want to run a script without copying and pasting it into a powershell WindowPowerShell window, I've hadI have to write the following command:

Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process -Force

I don't want to turn off the default behavior, since it prevents scripts from being run by accident or malwaremaliciously.

But I'd also like to be able to just open a powershellPowerShell window as my administrator account, and execute .\somescript.ps1 so that it runs.

Is it secure to place the line above in my powershell profile for so I don't have to manually run it every time I open Powershell as my Admin account, provided I still have UAC turned on (a.k.a. still have to type my password when opening a Powershell as Admin)?

Since the 20H2 build of Windows 10 came out, if I want to run a script without copying and pasting it into a powershell Window, I've had to write the following command:

Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process -Force

I don't want to turn off the default behavior, since it prevents scripts from being run by accident or malware.

But I'd also like to be able to just open a powershell window as my administrator account, and execute .\somescript.ps1 so that it runs.

Is it secure to place the line above in my powershell profile for so I don't have to manually run it every time I open Powershell as my Admin account, provided I still have UAC turned on (a.k.a. still have to type my password when opening a Powershell as Admin)?

Since the 20H2 build of Windows 10 came out, if I want to run a script without copying and pasting it into a PowerShell window, I have to write the following command:

Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process -Force

I don't want to turn off the default behavior, since it prevents scripts from being run by accident or maliciously.

But I'd also like to be able to just open a PowerShell window as my administrator account, and execute .\somescript.ps1 so that it runs.

Is it secure to place the line above in my powershell profile so I don't have to manually run it every time I open Powershell as my Admin account, provided I still have UAC turned on (a.k.a. still have to type my password when opening a Powershell as Admin)?

Clearer title
Link
Mike Ounsworth
  • 59.3k
  • 21
  • 162
  • 214

Should I use Is there a powershell profile in my administrator accountway to run Set-ExecutionPolicya downloaded powershell script as admin without setting a global ExecutionPolicy bypass?

Source Link
leeand00
  • 1.5k
  • 1
  • 14
  • 22

Should I use a powershell profile in my administrator account to run Set-ExecutionPolicy bypass?

Since the 20H2 build of Windows 10 came out, if I want to run a script without copying and pasting it into a powershell Window, I've had to write the following command:

Set-ExecutionPolicy -ExecutionPolicy ByPass -Scope Process -Force

I don't want to turn off the default behavior, since it prevents scripts from being run by accident or malware.

But I'd also like to be able to just open a powershell window as my administrator account, and execute .\somescript.ps1 so that it runs.

Is it secure to place the line above in my powershell profile for so I don't have to manually run it every time I open Powershell as my Admin account, provided I still have UAC turned on (a.k.a. still have to type my password when opening a Powershell as Admin)?