Skip to content

Instantly share code, notes, and snippets.

@TheBigBear
TheBigBear / WinGet_WinSrv.ps1
Created July 21, 2023 07:50 — forked from likamrat/WinGet_WinSrv.ps1
Installing Winget om Windows Server 2019/2022
Write-Information "This script needs be run on Windows Server 2019 or 2022"
If ($PSVersionTable.PSVersion.Major -ge 7){ Write-Error "This script needs be run by version of PowerShell prior to 7.0" }
# Define environment variables
$downloadDir = "C:\WinGet"
$gitRepo = "microsoft/winget-cli"
$msiFilenamePattern = "*.msixbundle"
$licenseFilenamePattern = "*.xml"
$releasesUri = "https://api.github.com/repos/$gitRepo/releases/latest"
@TheBigBear
TheBigBear / windows_openssh_authorized_keys_acl.ps1
Created July 26, 2022 17:37 — forked from scivision/windows_openssh_authorized_keys_acl.ps1
Set permissions ACL for Windows OpenSSH administrators_authorized_keys
# this script is copied from:
# https://www.concurrency.com/blog/may-2019/key-based-authentication-for-openssh-on-windows
# Script by Mitchell Grande of Concurrency.com
#
$acl = Get-Acl C:\ProgramData\ssh\administrators_authorized_keys
$acl.SetAccessRuleProtection($true, $false)
$administratorsRule = New-Object system.security.accesscontrol.filesystemaccessrule("Administrators","FullControl","Allow")
$systemRule = New-Object system.security.accesscontrol.filesystemaccessrule("SYSTEM","FullControl","Allow")
$acl.SetAccessRule($administratorsRule)
$acl.SetAccessRule($systemRule)
@TheBigBear
TheBigBear / Install-Programs
Created August 19, 2019 15:11
A Chocolatey PowerShell script to install programs to a newly paved Windows 8 machine, including development tools. Based on a gist from @amogram (https://gist.github.com/amogram/8217460)
# ==========================================================================
#
# Script Name: Install-Programs.ps1
#
# Author: Andy Parkhill
#
# Date Created: 27/03/2014
#
# Description: A simple environment setup script for my personal laptop.
#
@TheBigBear
TheBigBear / boxstarter.ps1
Created August 19, 2019 15:10
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
#
# 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:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
# OR
# Description: Techsnips-Repave Script
#
# 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:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
# OR
@TheBigBear
TheBigBear / Techsnips-Docker-Env-Setup
Created August 19, 2019 15:09
Techsnips-Docker-Env-Setup
# Description: Techsnips-Docker-Env-Setup
#
# 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:
# start http://boxstarter.org/package/nr/url?<URL-TO-RAW-GIST>
# OR
@TheBigBear
TheBigBear / boxstarter-full-win10.ps1
Created August 19, 2019 15:08
Boxstarter - Full - Windows 10
<#
.SYNOPSIS
BoxStarter script to configure Windows 10 development PC.
.DESCRIPTION
Install BoxStarter:
. { Invoke-WebRequest -useb http://boxstarter.org/bootstrapper.ps1 } | Invoke-Expression; get-boxstarter -Force
Run by calling the following from an **elevated** command-prompt.
Remove -DisableReboots parameter to allow the script to reboot as required.
@TheBigBear
TheBigBear / DevMachineSetup.ps1
Created August 19, 2019 15:08
Scripted install of all the tools needed on a new PC build
## Setup PowerShell
Set-ExecutionPolicy Bypass -Scope Process -Force
## Installers
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install webpicmd -y -v
## DotNET
@TheBigBear
TheBigBear / setup.ps1
Created August 19, 2019 15:08
Windoze dev setup
mkdir temp
cd temp
# Configure Windows
Set-WindowsExplorerOptions `
-EnableShowHiddenFilesFoldersDrives `
-EnableShowProtectedOSFiles `
-EnableShowFileExtensions `
-EnableShowFullPathInTitleBar
@TheBigBear
TheBigBear / basic-dev.ps1
Created August 19, 2019 15:07
My BoxStarter Scripts
# SQL Server - do this early to avoid issues with newer versions of VC++ 2015 redist
choco install sql-server-2017
choco install sql-server-2017-cumulative-update --version 14.0.3029.16
choco install sql-server-management-studio
# tools
choco install git
choco install nodejs
choco install tortoisegit
choco install visualstudiocode