This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Autorun script as Administrator | |
$admin = [Security.Principal.WindowsBuiltInRole] "Administrator" | |
$identity = [Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent() | |
if (!$identity.IsInRole($admin)) { | |
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit | |
} | |
## Admin tasks | |
$tcmdDir = (Get-Item -Path $PSCommandPath).Directory.FullName |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Autorun script as Administrator | |
$admin = [Security.Principal.WindowsBuiltInRole] "Administrator" | |
$identity = [Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent() | |
if (!$identity.IsInRole($admin)) { | |
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit | |
} | |
## Admin tasks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function NuGetAddLocalRepo ([string] $localRepoPath) | |
{ | |
## NuGet Package Manager config file path | |
$config = "$Env:APPDATA\NuGet\NuGet.Config" | |
If ( -Not (Test-Path($config)) ) { | |
Write-Host "NuGet Package Manager config not found!" | |
return | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
using System.Threading; | |
/// <summary> | |
/// An ASCII progress bar | |
/// </summary> | |
public class ProgressBar : IDisposable, IProgress<double> | |
{ | |
private const int blockCount = 10; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Concurrent; | |
using System.Diagnostics; | |
using System.Drawing; | |
using System.Drawing.Imaging; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Declare PtrSafe Function DispInvoke Lib "OleAut32" _ | |
(ByVal arg1 As LongPtr, _ | |
ByVal arg2 As LongPtr, _ | |
ByVal arg3 As Long, _ | |
ByVal arg4 As Integer, _ | |
arg5 As Any, _ | |
arg6 As Variant, _ | |
arg7 As Any, _ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
net session >nul 2>&1 | |
IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE | |
@GOTO ADMINTASKS | |
:ELEVATE | |
ECHO Elevated privileges are temporarily required to run script | |
cd /d %~dp0 | |
mshta "javascript: var shell = new ActiveXObject('Shell.Application'); shell.ShellExecute('%~nx0', '', '', 'runas', 1); close();" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | |
@IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE | |
@GOTO ADMINTASKS | |
:ELEVATE | |
ECHO Elevated privileges are temporarily required to run script | |
cd /d %~dp0 | |
mshta "javascript: var shell = new ActiveXObject('Shell.Application'); shell.ShellExecute('%~nx0', '', '', 'runas', 1); close();" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
net session >nul 2>&1 | |
IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE | |
@GOTO ADMINTASKS | |
:ELEVATE | |
ECHO Elevated privileges are temporarily required to run script | |
cd /d %~dp0 | |
mshta "javascript: var shell = new ActiveXObject('Shell.Application'); shell.ShellExecute('%~nx0', '', '', 'runas', 1); close();" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- USAGE EXAMPLE | |
<PropertyGroup> | |
<MyScript><![CDATA[ | |
function Foo() | |
{ | |
$targetFileName = args[0] | |
$targetPdbName = args[1] | |
$targetPath = args[2] |
NewerOlder