This file contains 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
# This fixes Permission denied errors you might get when | |
# there are git symlinks being used on repositories that | |
# you share in both POSIX (usually the host) and Windows (VM). | |
# | |
# This is not an issue if you are checking out the same | |
# repository separately in each platform. This is only an issue | |
# when it's the same working set (aka make a change w/out | |
# committing on OSX, go to Windows VM and git status would show | |
# you that change). | |
# |
This file contains 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
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one | |
# REMOVE ANYTHING BELOW THAT IS NOT NEEDED | |
$ErrorActionPreference = 'Stop'; # stop on all errors | |
$packageName= '[[PackageName]]' # arbitrary name for the package, used in messages | |
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" | |
$url = '[[Url]]' # download url | |
$url64 = '[[Url64]]' # 64bit URL here or remove - if installer is both, use $url | |
$packageArgs = @{ | |
packageName = $packageName |
This file contains 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
:: Pick one of these two files (cmd or ps1) | |
:: Set directory for installation - Chocolatey does not lock | |
:: down the directory if not the default | |
SET INSTALLDIR=c:\ProgramData\chocoportable | |
setx ChocolateyInstall %INSTALLDIR% | |
:: All install options - offline, proxy, etc at | |
:: https://chocolatey.org/install | |
@powershell -NoProfile -ExecutionPolicy Bypass -Command "(iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))) >$null 2>&1" && SET PATH="%PATH%;%INSTALLDIR%\bin" |
This file contains 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 Convert-FitbitToWithingsWeightMeasurements { | |
[CmdletBinding()] | |
Param( | |
[Parameter()] | |
[String] | |
$Folder =(Get-Location).Path | |
) | |
# Create a collection (a List for memory efficiency) to hold output | |
$WithingsWeightMeasurements = New-Object System.Collections.Generic.List[System.Object] |
This file contains 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
$googlePoliciesKey = 'HKLM:\Software\Policies\Google' | |
if (!(Test-Path $googlePoliciesKey)) { | |
New-Item -Path $googlePoliciesKey -Force | Out-Null | |
} | |
New-ItemProperty $googlePoliciesKey -Name 'UpdateDefault' -Value 0 -PropertyType DWORD -Force | Out-Null |
This file contains 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
public static class EnumerationExtensions | |
{ | |
public static IEnumerable<SelectListItem> GetEnumerationItems(this Enum enumeration) | |
{ | |
var listItems = Enum | |
.GetValues(enumeration.GetType()) | |
.OfType<Enum>() | |
.Select(e => | |
new SelectListItem() | |
{ |
This file contains 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
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA |
This file contains 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 Get-Input { | |
[CmdletBinding()] | |
param ( | |
[string]$abcdef = 'exe', | |
[parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments | |
) | |
$invocaton = $MyInvocation | |
$argumentsPassed = '' | |
foreach ($param in $PSBoundParameters.GetEnumerator()) { | |
$argumentsPassed += "-$($param.Key) '$($param.Value -Join ' ')' " |
This file contains 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
param ( | |
[parameter(Position=0)] | |
[alias("user")][string]$userName, | |
[alias("group")][string]$groupName=$null, | |
[alias("home")][string]$homeDirectory=$null | |
) | |
# there are some much simpler ways to do this with the Active-Directory Module | |
# like Get-ADUser, Set-ADUser, etc but it is not installed on Win2008 (non-R2) | |
# and below so we want to prefer what works natively for all Windows machines |
This file contains 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
public partial class CustomService : ServiceBase | |
{ | |
protected override void OnStop() | |
{ | |
//normal shutdown code here | |
} | |
protected override void OnStart(string[] args) | |
{ | |
//normal startup code here |
NewerOlder