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 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) | |
| } |
| -- 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 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:
| @ECHO OFF | |
| REM Uses the file name as the profile name | |
| SET MSTEAMS_PROFILE=%~n0 | |
| ECHO - Using profile "%MSTEAMS_PROFILE%" | |
| SET "OLD_USERPROFILE=%USERPROFILE%" | |
| SET "USERPROFILE=%LOCALAPPDATA%\Microsoft\Teams\CustomProfiles\%MSTEAMS_PROFILE%" | |
| REM Ensure there is a downloads folder to avoid error described at |
| # 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: |
| using System; | |
| using System.IO; | |
| using System.Reflection; | |
| namespace DAS.Utils | |
| { | |
| public static class EmbeddedResource | |
| { | |
| /// <summary> | |
| /// |