Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am zblesk on github.
  • I am zblesk (https://keybase.io/zblesk) on keybase.
  • I have a public key ASD5LC7NuuYBJcQRvBgo3NknVJOitOR7-hlu5K93BxqRUAo

To claim this, I am signing this object:

View database.sql
-- You can also create your DB schema, if needed
-- SSIS needs CLR enabled:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'clr enabled', 1;
GO
@zblesk
zblesk / self-elevating-script.ps1
Last active Apr 15, 2019
A self-elevating powershell script. Makes sure current script is running as admin.
View self-elevating-script.ps1
if (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Set-Location $PSScriptRoot
"Running as admin in $PSScriptRoot"
}
else
{
"NOT running as an admin!"
Start-Process powershell -WorkingDirectory $PSScriptRoot -Verb runAs -ArgumentList "-noprofile -noexit -file $PSCommandPath"
return "Script re-started with admin privileges in another shell. This one will now exit."