Skip to content

Instantly share code, notes, and snippets.

@mwrock
Last active March 17, 2019 17:37
Show Gist options
  • Save mwrock/e578e22000396173fa76 to your computer and use it in GitHub Desktop.
Save mwrock/e578e22000396173fa76 to your computer and use it in GitHub Desktop.
Philly Powershell Demos
Update-ExecutionPolicy Unrestricted
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
cinst console2
cinst sublimetext3
$sublimeDir = "$env:programfiles\Sublime Text 3"
Get-ChildItem $env:programdata\Chocolatey\lib\console* | % {$consoleDir = $_}
Install-ChocolateyPinnedTaskBarItem "$consoleDir\tools\console2\console.exe"
Install-ChocolateyPinnedTaskBarItem "$sublimeDir\sublime_text.exe"
Install-ChocolateyFileAssociation ".txt" "$sublimeDir\sublime_text.exe"
Import-Module c:\dev\boxstarter\Boxstarter.Chocolatey\Boxstarter.Chocolatey.psd1 -Force
sub C:\dev\demo\repo\wrocklight
Set-BoxStarterConfig -LocalRepo c:\dev\demo\repo
New-BoxstarterPackage -Name wrocklight -description 'light weight install' -path 'C:\Users\Matt\AppData\Roaming\Sublime Text 3'
Copy-Item $env:appdata\console\console.xml C:\dev\demo\repo\wrocklight
Invoke-BoxStarterBuild -name wrocklight
$c = Get-Credential win81\matt
Enable-BoxstarterVM -Provider hyperv -VMName win8.1 -Credential $c -CheckpointName TestBase -Verbose | Install-BoxstarterPackage -PackageName wrocklight -Force -Verbose
try {
Update-ExecutionPolicy Unrestricted
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
cinst console2
cinst sublimetext3
$sublimeDir = "$env:programfiles\Sublime Text 3"
$sublimeUserDir = "$env:appdata\Sublime Text 3"
Get-ChildItem $env:programdata\Chocolatey\lib\console* | % {$consoleDir = $_}
Install-ChocolateyPinnedTaskBarItem "$consoleDir\tools\console2\console.exe"
Install-ChocolateyPinnedTaskBarItem "$sublimeDir\sublime_text.exe"
Install-ChocolateyFileAssociation ".txt" "$sublimeDir\sublime_text.exe"
mkdir $sublimeUserDir -Force
mkdir $env:appdata\console -Force
copy-item (Join-Path "$(Get-PackageRoot($MyInvocation))\sublime text 3" '*') -Force -Recurse $sublimeUserDir
copy-item (Join-Path "$(Get-PackageRoot($MyInvocation))" 'console.xml') -Force $env:appdata\console\console.xml
Write-ChocolateySuccess 'wrocklight'
} catch {
Write-ChocolateyFailure 'wrocklight' $($_.Exception.Message)
throw
}
Import-Module c:\dev\boxstarter\Boxstarter.TestRunner\Boxstarter.TestRunner.psd1 -Force
Set-BoxstarterDeployOptions -DeploymentTargetCredentials $c -DeploymentTargetNames win8.1 -DeploymentVMProvider hyperv -RestoreCheckpoint testready -DefaultNugetFeed http://www.myget.org/F/boxstarter/api/v2 -DefaultFeedAPIKey
Test-BoxstarterPackage | Select-BoxstarterResultsToPublish | Publish-BoxstarterPackage
cd c:\dev\chocolatey-packages
Set-BoxStarterConfig -LocalRepo .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment