Setting up Chocolatey for Business (C4B) with Quick Deployment Environment (QDE) using Desired State Configuration (DSC)
- Install NuGet and PowerShellGet, and trust the PowerShell Gallery:
Install-PackageProvider -Name NuGet -Force| # Create a user account at cloudsmith.io | |
| # Create an Org and Repository at cloudsmith.io | |
| # In your PowerShell console, | |
| # check that PSGallery repo is present only | |
| Get-PSRepository | |
| # Build Repository Source URI | |
| $RepoName = 'YOUR-REPO-NAME' | |
| $OrgName = 'YOUR-ORG' | 
| # Create a user account at cloudsmith.io | |
| # Create an Org and Repository at cloudsmith.io | |
| # Build Repository Source URI | |
| $RepoName = 'psdemo' | |
| $User = 'YOUR_USER_NAME_HERE' | |
| $RepoSource = "https://nuget.cloudsmith.io/$User/$RepoName/v2/" | |
| # We needa a PSCredential to upload to repo | |
| $Key = $ENV:CLOUDSMITH_API_KEY | 
| Stop-Service nexus | |
| #Backup SSL Configuration | |
| if(-not (Test-Path C:\nexusbackup)){ | |
| New-Item C:\nexusbackup -ItemType Directory | |
| } | |
| if(Test-Path C:\ProgramData\nexus\etc\ssl\keystore.jks){ | |
| Copy-Item C:\ProgramData\nexus\etc\ssl\keystore.jks C:\nexusbackup | |
| } | 
I hereby claim:
To claim this, I am signing this object:
| # Author: Colin Andress | |
| # Modified by: adilio | |
| # Github Link: https://github.com/Column01 | |
| Write-Output 'Getting Windows User and Slack version' | |
| $user = $env:UserName | |
| if (Test-Path -Path "C:\Users\$user\AppData\Roaming\Slack\storage\slack-settings") { | |
| $json = Get-Content "C:\Users\$user\AppData\Roaming\Slack\storage\slack-settings" | Out-String | ConvertFrom-Json | |
| } | |
| else { | |
| Write-Output 'Unable to find the slack version info. Is slack installed from the windows store? Make sure it is from the slack website!' | 
| @echo off | |
| if "%1%" == "precustomization" ( | |
| echo No pre-customization tasks to run | |
| ) else if "%1%" == "postcustomization" ( | |
| echo Running post-customization tasks | |
| reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff" /f | |
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f | |
| reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v EnableLUA /t REG_DWORD /d 0 /f | |
| reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f | |
| netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes | 
| # Run this script in an elevated prompt, and quit and reload Slack after | |
| $slackBaseDir = "C:\Program Files\Slack\" | |
| $installations = Get-ChildItem $slackBaseDir -Directory | Where-Object { $_.Name.StartsWith("app-") } | |
| $version = $installations | Sort-Object { [version]$_.Name.Substring(4) } | Select-Object -Last 1 | |
| Write-Output "Choosing highest present Slack version: $version" | |
| $customContent = @' | |
| // First make sure the wrapper app is loaded | 
| <# | |
| Write-Log.ps1 | |
| 20181027 - 4dilio | |
| Simple function to write to a log file. | |
| You MUST define $Log in your script. | |
| #> | |
| function Write-Log { | |
| [CmdletBinding()] | |
| param( |