Unpacking Software Livestream

Join our monthly Unpacking Software livestream to hear about the latest news, chat and opinion on packaging, software deployment and lifecycle management!

Learn More

Chocolatey Product Spotlight

Join the Chocolatey Team on our regular monthly stream where we put a spotlight on the most recent Chocolatey product releases. You'll have a chance to have your questions answered in a live Ask Me Anything format.

Learn More

Chocolatey Coding Livestream

Join us for the Chocolatey Coding Livestream, where members of our team dive into the heart of open source development by coding live on various Chocolatey projects. Tune in to witness real-time coding, ask questions, and gain insights into the world of package management. Don't miss this opportunity to engage with our team and contribute to the future of Chocolatey!

Learn More

Calling All Chocolatiers! Whipping Up Windows Automation with Chocolatey Central Management

Webinar from
Wednesday, 17 January 2024

We are delighted to announce the release of Chocolatey Central Management v0.12.0, featuring seamless Deployment Plan creation, time-saving duplications, insightful Group Details, an upgraded Dashboard, bug fixes, user interface polishing, and refined documentation. As an added bonus we'll have members of our Solutions Engineering team on-hand to dive into some interesting ways you can leverage the new features available!

Watch On-Demand
Chocolatey Community Coffee Break

Join the Chocolatey Team as we discuss all things Community, what we do, how you can get involved and answer your Chocolatey questions.

Watch The Replays
Chocolatey and Intune Overview

Webinar Replay from
Wednesday, 30 March 2022

At Chocolatey Software we strive for simple, and teaching others. Let us teach you just how simple it could be to keep your 3rd party applications updated across your devices, all with Intune!

Watch On-Demand
Chocolatey For Business. In Azure. In One Click.

Livestream from
Thursday, 9 June 2022

Join James and Josh to show you how you can get the Chocolatey For Business recommended infrastructure and workflow, created, in Azure, in around 20 minutes.

Watch On-Demand
The Future of Chocolatey CLI

Livestream from
Thursday, 04 August 2022

Join Paul and Gary to hear more about the plans for the Chocolatey CLI in the not so distant future. We'll talk about some cool new features, long term asks from Customers and Community and how you can get involved!

Watch On-Demand
Hacktoberfest Tuesdays 2022

Livestreams from
October 2022

For Hacktoberfest, Chocolatey ran a livestream every Tuesday! Re-watch Cory, James, Gary, and Rain as they share knowledge on how to contribute to open-source projects such as Chocolatey CLI.

Watch On-Demand

(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


Validation Testing Passed


Verification Testing Exemption:

Requires Windows 10/11.

Details

Scan Testing Successful:

No detections found in any package files

Details
Learn More

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:

NOTE

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

  • 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

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.

WARNING

There are versions of this package awaiting moderation . See the Version History section below.

Package Approved

This package was approved by moderator Windos on 21 Nov 2023.

Description


choco://choco-sandbox

To use choco:// protocol URLs, install (unofficial) choco:// Protocol support


Screenshot of choco-sandbox

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



tools\chocolateyInstall.ps1
$ErrorActionPreference = 'Stop'
$packageName  = 'choco-sandbox'
$shortcutName = 'Chocolatey Sandbox.lnk'
$scriptDir    = "$(Get-ToolsLocation)\BCURRAN3\choco-sandbox"
$script       = 'choco-sandbox.ps1'
$toolsDir     = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$exe          = "$toolsDir\choco-sandbox.wsb"

Confirm-WinMinimumBuild 18305

# Update the WSB (config) file if the Chocolatey Tools Location is non-default
if ($(Get-ToolsLocation) -ne "C:\tools"){
	[xml]$WSBConfig = Get-Content "$exe"
    $WSBConfig.Configuration.MappedFolders.MappedFolder.HostFolder = "$scriptDir"
    Write-Host "  ** Updating WSB file with your defined Chocolatey tools dir." -Foreground Magenta
	$WSBConfig.Save("$exe")
}

# New storage location moving forward for all my Chocolatey scripts
if (!(Test-Path "$(Get-ToolsLocation)\BCURRAN3")) { New-Item -Path "$(Get-ToolsLocation)" -Name "BCURRAN3" -ItemType "Directory" | Out-Null }
if (!(Test-Path "$(Get-ToolsLocation)\BCURRAN3\choco-sandbox")) { New-Item -Path "$(Get-ToolsLocation)\BCURRAN3" -Name "choco-sandbox" -ItemType "Directory" | Out-Null }

# Move new files and support files (if applicable)
Move-Item "$toolsDir\$script" "$scriptDir" -Force -ErrorAction SilentlyContinue
Move-Item "$toolsDir\$exe" "$scriptDir" -Force -ErrorAction SilentlyContinue
Move-Item "$toolsDir\choco-sandbox-customize.ps1.example" "$scriptDir" -Force -ErrorAction SilentlyContinue
Move-Item "$toolsDir\Microsoft.PowerShell_profile.ps1" "$scriptDir" -Force -ErrorAction SilentlyContinue
Move-Item "$toolsDir\packages.config.example" "$scriptDir" -Force -ErrorAction SilentlyContinue
Move-Item "$toolsDir\ReadMe.txt" "$scriptDir" -Force -ErrorAction SilentlyContinue

# Make shortcuts
Install-ChocolateyShortcut -shortcutFilePath "$ENV:Public\Desktop\$shortcutName" -targetPath $exe -IconLocation "$toolsDir\Chocolatey Sandbox.ico" -RunAsAdmin
if (Test-Path "$ENV:ProgramData\Microsoft\Windows\Start Menu\Programs\Chocolatey"){
    Install-ChocolateyShortcut -shortcutFilePath "$ENV:ProgramData\Microsoft\Windows\Start Menu\Programs\Chocolatey\$shortcutName" -targetPath $exe  -IconLocation "$toolsDir\Chocolatey Sandbox.ico" -RunAsAdmin
   } else {
     Install-ChocolateyShortcut -shortcutFilePath "$ENV:ProgramData\Microsoft\Windows\Start Menu\Programs\$shortcutName" -targetPath $exe  -IconLocation "$toolsDir\Chocolatey Sandbox.ico" -RunAsAdmin
    }
tools\chocolateyUninstall.ps1
$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
tools\Microsoft.PowerShell_profile.ps1
# 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
}
tools\packages.config.example
 
tools\ReadMe.txt
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
tools\.SkipAutoUninstaller
 
tools\choco-sandbox-customize.ps1.example
 
tools\choco-sandbox.ps1
# 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
tools\choco-sandbox.wsb
 
tools\Chocolatey Sandbox.ico
 

Log in or click on link to see number of positives.

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

CHANGELOG:

  • 1.0.0 - Initial release. No upgrades or features planned, only maintenance if needed for future Windows or Windows Sandbox compatibility.
Discussion for the (unofficial) Chocolatey Sandbox Package

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.
comments powered by Disqus