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
/* groovylint-disable JavaIoPackageAccess, SystemExit, VariableTypeRequired */ | |
if (args.length < 1) { | |
println 'Please provide either the script file path or the script content as a string.' | |
System.exit(1) | |
} | |
// Check if input is a file path or script content | |
def scriptInput = args[0] | |
def scriptFile = new File(scriptInput) |
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
#region fix PSModulePath in PowerShell Desktop when indirectly called from pwsh | |
function Invoke-FixPSModulePathForPowerShellDesktopWhenIndirectlyCalledFromPwsh { | |
if (($env:PSModulePath -split ';') -contains "${env:ProgramFiles}\PowerShell\Modules") { | |
# need to rip out the good bits for pwsh -> something -> powershell call chain | |
# chocolateyInstall\helpers\functions\Get-EnvironmentVariable.ps1 | |
function Get-EnvironmentVariable { | |
<# | |
.SYNOPSIS |
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
<# | |
.SYNOPSIS | |
BoxStarter script to configure Windows 10 development PC. | |
.DESCRIPTION | |
You might need to set: | |
Set-ExecutionPolicy RemoteSigned | |
Set-ExecutionPolicy Unrestricted | |
Set-ExecutionPolicy Bypass |
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
choco install pwsh -y | |
choco install ripgrep -y | |
choco install vscode -y | |
Get-WindowsCapability -Online | Where-Object {$_.Name -like 'OpenSSH*'} | Add-WindowsCapability -Online | |
Start-Service sshd | |
Set-Service sshd -StartupType Automatic | |
Stop-Service sshd |
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
# NuGet package provider. Do this early as reboots are required | |
if (-not (Get-PackageProvider -Name NuGet -ErrorAction SilentlyContinue)) { | |
Write-Host "Install-PackageProvider" | |
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope AllUsers -Confirm:$False | |
# Exit equivalent | |
Invoke-Reboot | |
} |
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
[cmdletbinding()] | |
param( | |
$packageName | |
) | |
$ErrorActionPreference = 'Stop' | |
function Test-TransitiveDependencies { | |
[cmdletbinding()] | |
param($allPackages, $pkgID) |
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-UglyButShortUniqueDirname { | |
[CmdletBinding()] | |
param ( | |
) | |
$t = "$([System.Guid]::NewGuid())".Replace("-", "") | |
Write-Verbose "base guid: $t" | |
$t = "$(0..$t.Length | % { if (($_ -lt $t.Length) -and !($_%2)) { [char][byte]"0x$($t[$_])$($t[$_+1])" } })".replace(" ", "").Trim() |
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
wget https://download.foldingathome.org/releases/public/release/fahclient/debian-testing-64bit/v7.4/fahclient_7.4.4_amd64.deb | |
wget https://download.foldingathome.org/releases/public/release/fahcontrol/debian-testing-64bit/v7.4/fahcontrol_7.4.4-1_all.deb | |
wget https://download.foldingathome.org/releases/public/release/fahviewer/debian-testing-64bit/v7.4/fahviewer_7.4.4_amd64.deb | |
sudo dpkg -i --force-depends fahclient_7.4.4_amd64.deb | |
sudo dpkg -i --force-depends fahcontrol_7.4.4-1_all.deb | |
sudo dpkg -i --force-depends fahviewer_7.4.4_amd64.deb |
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 Add-TrustedHostDownloadSite { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string]$ServerName, | |
[Parameter(Mandatory = $false)] | |
[string]$Domain = "myorg.somedomain" | |
) | |
Push-Location |
NewerOlder