I hereby claim:
- I am danielsmon on github.
- I am danielsmon (https://keybase.io/danielsmon) on keybase.
- I have a public key ASDDsqGt-EUwIXNtuNEQbgdQQFxXms4vSS3cVHxcbwv-sgo
To claim this, I am signing this object:
Function Test-Redirect($uri, $expectedStatusCode, $expectedRedirect) { | |
try { | |
$result = Invoke-WebRequest -MaximumRedirection 0 -Uri $uri -SkipHeaderValidation | |
Write-Host -ForegroundColor Red "Failed " -NoNewline | |
Write-Host $uri -NoNewline | |
Write-Host " Expected:" $expectedStatusCode $expectedRedirect " " -NoNewline | |
Write-Host "Received:" $result.StatusCode -BackgroundColor Yellow | |
} catch { | |
$_Exception |
robocopy %full_path% %TEMP% /S /L /BYTES /XJ /NFL /NDL /NJH |
I hereby claim:
To claim this, I am signing this object:
# Description: Boxstarter Script | |
# Author: Jess Frazelle <jess@linux.com> | |
# Last Updated: 2017-09-11 | |
# | |
# Install boxstarter: | |
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
# | |
# You might need to set: Set-ExecutionPolicy RemoteSigned | |
# | |
# Run this boxstarter by calling the following from an **elevated** command-prompt: |
@ECHO OFF | |
REM Rename this file to be the same name as your PowerShell .ps1 script. | |
REM This script must be in the same directory as your .ps1 script. | |
PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -Command ""& {%~dpn0.ps1;pause}""' -Verb RunAs}" |
@ECHO OFF | |
IF X%1==X GOTO INVALID_ARGS | |
IF X%2==X GOTO INVALID_ARGS | |
GOTO:RUN | |
:INVALID_ARGS | |
ECHO Invalid arguments | |
ECHO. |
-- For more useful info on permissions, see: | |
-- https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-database-role-members-transact-sql?view=sqlallproducts-allversions | |
-- Create logins and users on Azure SQL databases. | |
-- Adjust roles and schemas appropriately | |
DECLARE @user varchar(255) = 'USERNAME'; | |
DECLARE @pass varchar(255) = 'PASSWORD'; | |
DECLARE @schema varchar(255) = '[dbo]'; | |
IF ((SELECT DB_NAME()) = 'master') |
Function Decrypt-SecureString { | |
param( | |
[Parameter(ValueFromPipeline=$true,Mandatory=$true,Position=0)] | |
[System.Security.SecureString] | |
$sstr | |
) | |
$marshal = [System.Runtime.InteropServices.Marshal] | |
$ptr = $marshal::SecureStringToBSTR( $sstr ) | |
$str = $marshal::PtrToStringBSTR( $ptr ) | |
$marshal::ZeroFreeBSTR( $ptr ) |
Function Test-Administrator | |
{ | |
$user = [Security.Principal.WindowsIdentity]::GetCurrent(); | |
(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) | |
} |