Skip to main content

powershell

Powershell

  • Como saber se a conexão do SQL SERVER está funcionando

    $conn = New-Object System.Data.SqlClient.SqlConnection
    $conn.ConnectionString = "Server=(local);Database=Sample;Integrated Security=True;"
    $conn.Open()
    $conn.Close()

Execution Policy Type:

  • Restricted - No Script either local, remote or downloaded can be executed on the system.
  • AllSigned - All script that are ran require to be digitally signed.
  • RemoteSigned - All remote scripts (UNC) or downloaded need to be signed.
  • Unrestricted - No signature for any type of script is required.

Execution Policy Type:

  • LocalMachine - The execution policy affects all users of the computer.
  • CurrentUser - The execution policy affects only the current user.
  • Process - The execution policy affects only the current Windows PowerShell process.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser