Downloads:
161
Downloads of v 1.0.0:
146
Last Update:
02 Nov 2023
Package Maintainer(s):
Software Author(s):
- bcurran3
Tags:
bcurran3 unofficial chocolatey powershell sandbox test environment packagers maintainers(unofficial) Chocolatey Sandbox
- 1
- 2
- 3
1.0.0 | Updated: 02 Nov 2023
Downloads:
161
Downloads of v 1.0.0:
146
Maintainer(s):
Software Author(s):
- bcurran3
(unofficial) Chocolatey Sandbox 1.0.0
Legal Disclaimer: Neither this package nor Chocolatey Software, Inc. are affiliated with or endorsed by bcurran3. The inclusion of bcurran3 trademark(s), if any, upon this webpage is solely to identify bcurran3 goods or services and not for commercial purposes.
- 1
- 2
- 3
This Package Contains an Exempted Check
Not All Tests Have Passed
Deployment Method: Individual Install, Upgrade, & Uninstall
To install (unofficial) Chocolatey Sandbox, run the following command from the command line or from PowerShell:
To upgrade (unofficial) Chocolatey Sandbox, run the following command from the command line or from PowerShell:
To uninstall (unofficial) Chocolatey Sandbox, run the following command from the command line or from PowerShell:
Deployment Method:
This applies to both open source and commercial editions of Chocolatey.
1. Enter Your Internal Repository Url
(this should look similar to https://community.chocolatey.org/api/v2/)
2. Setup Your Environment
1. Ensure you are set for organizational deployment
Please see the organizational deployment guide
2. Get the package into your environment
Option 1: Cached Package (Unreliable, Requires Internet - Same As Community)-
Open Source or Commercial:
- Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://community.chocolatey.org/api/v2/. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
- You can also just download the package and push it to a repository Download
-
Open Source
-
Download the package:
Download - Follow manual internalization instructions
-
-
Package Internalizer (C4B)
-
Run: (additional options)
choco download choco-sandbox --internalize --source=https://community.chocolatey.org/api/v2/
-
For package and dependencies run:
choco push --source="'INTERNAL REPO URL'"
- Automate package internalization
-
Run: (additional options)
3. Copy Your Script
choco upgrade choco-sandbox -y --source="'INTERNAL REPO URL'" [other options]
See options you can pass to upgrade.
See best practices for scripting.
Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.
If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:
choco upgrade choco-sandbox -y --source="'INTERNAL REPO URL'"
$exitCode = $LASTEXITCODE
Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
Exit 0
}
Exit $exitCode
- name: Install choco-sandbox
win_chocolatey:
name: choco-sandbox
version: '1.0.0'
source: INTERNAL REPO URL
state: present
See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.
chocolatey_package 'choco-sandbox' do
action :install
source 'INTERNAL REPO URL'
version '1.0.0'
end
See docs at https://docs.chef.io/resource_chocolatey_package.html.
cChocoPackageInstaller choco-sandbox
{
Name = "choco-sandbox"
Version = "1.0.0"
Source = "INTERNAL REPO URL"
}
Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.
package { 'choco-sandbox':
ensure => '1.0.0',
provider => 'chocolatey',
source => 'INTERNAL REPO URL',
}
Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.
4. If applicable - Chocolatey configuration/installation
See infrastructure management matrix for Chocolatey configuration elements and examples.
There are versions of this package awaiting moderation . See the Version History section below.
This package was approved by moderator Windos on 21 Nov 2023.
choco://choco-sandbox
To use choco:// protocol URLs, install (unofficial) choco:// Protocol support
WHAT IS THIS?
Chocolatey Sandbox sets up a customized and customizable Windows Sandbox environment with Chocolatey installed.
WHO IS THIS FOR?
Chocolatey Sandbox is for anyone who may want to "test drive" Chocolatey packages in a sandbox.
FEATURES:
- Installs Chocolatey from the web on first run and caches it for subsequent runs of the sandbox.
- Automatically upgrades Chocolatey to the latest version on every run.
- Automatically sets up the default PowerShell profile with Chocolatey tab completion as well as some shortcuts (cup, cinst, cuninst, clist).
- Automatically installs packages from packages.config if it exists.
- Automatically runs choco-sandbox-customize.ps1 for further customization if it exists.
If you find Chocolatey Sandbox useful, please consider donating:
https://www.paypal.me/bcurran3donations or become a patron at https://www.patreon.com/bcurran3
$ErrorActionPreference = 'Stop'
$packageName = 'choco-windows-sandbox'
$shortcutName = 'Chocolatey Sandbox.lnk'
$scriptDir = "$(Get-ToolsLocation)\BCURRAN3\choco-sandbox"
Remove-Item "$scriptDir" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item "$ENV:Public\Desktop\$shortcutName" -Force -ErrorAction SilentlyContinue
Remove-Item "$ENV:ProgramData\Microsoft\Windows\Start Menu\Programs\Chocolatey\$shortcutName" -Force -ErrorAction SilentlyContinue
Remove-Item "$ENV:ProgramData\Microsoft\Windows\Start Menu\Programs\$shortcutName" -Force -ErrorAction SilentlyContinue
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
function cinst {choco install $args}
function cuninst {choco uninstall $args}
function cup {choco upgrade $args}
function clist {choco list $args}
function cweb {param ([string]$package )
if (($package -eq '') -or ($package -eq '.')) {$package=(Split-Path -Leaf $(Get-Location).Path)}
start https://community.chocolatey.org/packages/$package
}
Choco-Sandbox.ps1 v1.0.0 (2023-10-02) - Sets up Windows Sandbox with Chocolatey Installed
Copyleft 2023 Bill Curran ([email protected]) - free for personal and commercial use
You can customize your choco-sandbox environment further by editing any of the files
mentioned below. If your ChocolateyToolsDir is writeable by the host computer's Users group,
you can edit the files from within the sandbox in the C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox
folder. Otherwise edit them outside the sandbox in the paths mentioned.
C:\tools\BCURRAN3\choco-sandbox\
- You can put any files you want in here and they will remain unless you uninstall choco-sandbox.
C:\tools\BCURRAN3\choco-sandbox\packages.config.example
- Rename to packages.config and edit for any Chocolatey packages you want to have installed
automatically. If you just rename it, it will install Google Chrome.
C:\tools\BCURRAN3\choco-sandbox\choco-sandbox-customize.ps1.example
- Rename to choco-sandbox-customize.ps1 and edit. It will run in the sandbox after everything else
is done. You can use this for any further customization you want done automatically in the
sandbox; i.e. enable more Chocolatey features, map drives, edit registry keys, etc. If you just
rename it, it will run choco feature enable -n allowGlobalConfirmation.
C:\tools\BCURRAN3\choco-sandbox\Microsoft.PowerShell_profile.ps1
- Edit this to modify your default PowerShell profile in the sandbox. It will be copied on every
run of Chocolatey Sandbox. This could be overwritten if choco-sandbox is ever updated.
C:\ProgramData\chocolatey\lib\choco-sandbox\tools\choco-sandbox.wsb
- Edit this (XML file) to add more mapped folders; i.e. c:\shared. More info at:
https://learn.microsoft.com/en-us/windows/security/application-security/application-isolation/windows-sandbox/windows-sandbox-configure-using-wsb-file
This could be overwritten if choco-sandbox is ever updated.
Found Chocolatey Sandbox useful?
Buy me a beer at https://www.paypal.me/bcurran3donations
Become a patron at https://www.patreon.com/bcurran3
# Choco-Sandbox.ps1 Copyleft 2023 by Bill Curran AKA BCURRAN3
# LICENSE: GNU GPL v3 - https://www.gnu.org/licenses/gpl.html
# Suggestions? Problems? Open a GitHub issue at https://github.com/bcurran3/ChocolateyPackages/issues
Clear-Host
Write-Host "Choco-Sandbox.ps1 v1.0.0 (2023-10-02) - Sets up Windows Sandbox with Chocolatey Installed" -Foreground White
Write-Host "Copyleft 2023 Bill Curran ([email protected]) - free for personal and commercial use`n" -Foreground White
$InstalledFromWeb=$False
# Allow all scripts to run since its a sandbox
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force
# Add PowerShell profile with Chocolatey tab completion
if (!(Test-Path "C:\Users\WDAGUtilityAccount\Documents\WindowsPowerShell")) { New-Item -Path "C:\Users\WDAGUtilityAccount\Documents" -Name "WindowsPowerShell" -ItemType "Directory" | Out-Null }
Copy-Item "C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\Microsoft.PowerShell_profile.ps1" "C:\Users\WDAGUtilityAccount\Documents\WindowsPowerShell\"
# Install Chocolatey from previously downloadeded file so we don't skew the download count too much for Rob and the boys
if (Test-Path C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\chocolatey.zip){
Write-Host " ** Installing Chocolatey from cached download." -Foreground Magenta
Expand-Archive C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\chocolatey.zip -DestinationPath C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\chocolatey -Force | Out-Null
C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\chocolatey\tools\chocolateyInstall.ps1 | Out-Null
Copy-Item C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\chocolatey.zip C:\ProgramData\chocolatey\lib\chocolatey\chocolatey.nupkg
Copy-Item C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\chocolatey\chocolatey.nuspec C:\ProgramData\chocolatey\lib\chocolatey
Remove-Item C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\chocolatey -Recurse -Force
} else {
# Install Chocolatey from the web
Write-Host " ** Installing Chocolatey from the web." -Foreground Magenta
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | Out-Null
# Save chocolatey.zip for future use so we don't have to continuously download it
Move-Item C:\Users\WDAGUtilityAccount\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox
$InstalledFromWeb=$True
}
# Upgrade Chocolatey if outdated
if (!($InstalledFromWeb)){
Write-Host " ** Making sure Chocolatey is up-to-date..." -Foreground Magenta
choco upgrade chocolatey
if (Test-Path C:\Users\WDAGUtilityAccount\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip){
Move-Item C:\Users\WDAGUtilityAccount\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox -Force
}
}
# Install packages
if (Test-Path C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\packages.config){
Write-Host " ** Installing packages from packages.config..." -Foreground Magenta
choco install C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\packages.config
}
# Load Chocolatey PowerShell profile
. $profile
# Run custom script
if (Test-Path C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\choco-sandbox-customize.ps1){
Write-Host " ** Running choco-sandbox-customize.ps1..." -Foreground Magenta
& C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox\choco-sandbox-customize.ps1 -ErrorActtion SilentlyContinue
}
Set-Location "C:\Users\WDAGUtilityAccount\Desktop\choco-sandbox"
Write-Host "`nGo Go Chocolatey Go!" -Foreground White
Write-Host "`nFound Chocolatey Sandbox useful?" -Foreground White
Write-Host "Buy me a beer at https://www.paypal.me/bcurran3donations" -Foreground White
Write-Host "Become a patron at https://www.patreon.com/bcurran3" -Foreground White
Log in or click on link to see number of positives.
- choco-sandbox.1.0.0.nupkg (a1c5c3a71056) - ## / 58
In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).
Chocolatey Pro provides runtime protection from possible malware.
Add to Builder | Version | Downloads | Last Updated | Status |
---|---|---|---|---|
Chocolatey Sandbox (unofficial) 1.0.1 | 15 | Friday, November 8, 2024 | Ready | |
(unofficial) Chocolatey Sandbox 1.0.0 | 146 | Thursday, November 2, 2023 | Approved |
public domain
CHANGELOG:
- 1.0.0 - Initial release. No upgrades or features planned, only maintenance if needed for future Windows or Windows Sandbox compatibility.
-
- chocolatey-os-dependency.extension (≥ 0.0.1)
- windows-sandbox (≥ 0.0.1)
Ground Rules:
- This discussion is only about (unofficial) Chocolatey Sandbox and the (unofficial) Chocolatey Sandbox package. If you have feedback for Chocolatey, please contact the Google Group.
- This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
- The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
- Tell us what you love about the package or (unofficial) Chocolatey Sandbox, or tell us what needs improvement.
- Share your experiences with the package, or extra configuration or gotchas that you've found.
- If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.