From 4a4c1c80a5bdab99d7ca8fa6f1e165a85b7344d0 Mon Sep 17 00:00:00 2001 From: Rob Hux Date: Sat, 9 Jun 2018 14:49:29 -0400 Subject: [PATCH 01/11] creating an array script --- dev_array.ps1 | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 dev_array.ps1 diff --git a/dev_array.ps1 b/dev_array.ps1 new file mode 100644 index 00000000..6476ab9b --- /dev/null +++ b/dev_array.ps1 @@ -0,0 +1,163 @@ +# Description: Boxstarter Script +# Author: Microsoft +# Common dev settings for desktop app development + +Disable-UAC + +#--- Windows Subsystems/Features --- +choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures +choco install -y Microsoft-Hyper-V-All -source windowsFeatures +#choco install -y docker-for-windows + +#--- Configuring Windows properties --- +#--- Windows Features --- +Set-TaskbarSmall +Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions + +#--- File Explorer Settings --- +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneExpandToCurrentFolder -Value 1 +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name NavPaneShowAllFolders -Value 1 +# open file explorer to "this pc" +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name LaunchTo -Value 1 +# Show taskbar on all monitors +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarEnabled -Value 1 +# Show taskbar buttons on taskbar where window is open +Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced -Name MMTaskbarMode -Value 2 + +#--- Enabling developer mode on the system --- +Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense -Value 1 + +#--- Ubuntu --- +Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.appx -UseBasicParsing + + +#--- VS 2017 uwp and azure workloads + git tools --- +# See this for install args: https://chocolatey.org/packages/VisualStudio2017Professional +# https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community +# https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio#list-of-workload-ids-and-component-ids +choco install -y visualstudio2017professional --package-parameters "--add Microsoft.VisualStudio.Workload.CoreEditor --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.NetCoreTools --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.Net.ComponentGroup.TargetingPacks.Common --add Microsoft.Component.Azure.DataLake.Tools --add Microsoft.VisualStudio.Component.Azure.ResourceManager.Tools --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices --add Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.ComponentGroup.Web.CloudTools --add Microsoft.VisualStudio.Component.AppInsights.Tools --add Microsoft.VisualStudio.Component.Wcf.Tooling --add Microsoft.Net.Component.4.6.2.SDK --add Microsoft.Net.Component.4.7.SDK --add Microsoft.Net.Component.4.7.1.SDK --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.Component.4.7.TargetingPack --add Microsoft.Net.Component.4.7.1.TargetingPack --add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools --add Microsoft.VisualStudio.Component.Azure.Storage.AzCopy --add Microsoft.VisualStudio.Component.AspNet45 --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.Component.Azure.Waverton --add Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools --add Microsoft.VisualStudio.Component.TypeScript.2.1 --add Microsoft.VisualStudio.Component.TypeScript.2.2 --add Microsoft.VisualStudio.Component.TypeScript.2.5 --add Microsoft.VisualStudio.Component.TypeScript.2.6 --add Microsoft.VisualStudio.Component.TestTools.Core --add Microsoft.VisualStudio.Component.Git --remove Component.Redgate.SQLSearch.VSExtension --remove Component.Dotfuscator --remove Microsoft.ComponentGroup.Blend --remove Microsoft.Component.HelpViewer" +RefreshEnv + +choco install chocolatey-visualstudio.extension +RefreshEnv + +choco install -y KB2919355 KB2919442 KB2999226 KB3033929 KB3035131 chocolatey-windowsupdate.extension chocolatey-core.extension vcredist140 vcredist2010 vcredist2015 +RefreshEnv + +choco install -y git -params '"/GitOnlyOnPath /WindowsTerminal"' +RefreshEnv +choco install -y googlechrome Firefox +RefreshEnv + +choco install -y 7zip 7zip.install curl cmder FiraCode kdiff3 keepass keepass.instal nodejs nodejs.install paint.net notepadplusplus notepadplusplus.install poshgit +choco install -y SourceTree resharper sysinternals yarn +RefreshEnv + +choco install -y visualstudiocode +RefreshEnv + +code --install-extension aureliaeffect.aurelia +code --install-extension behzad88.aurelia +code --install-extension steoates.autoimport +code --install-extension jerryhong.autofilename +code --install-extension ms-vscode.azure-account +code --install-extension ms-azuretools.vscode-azureappservice +code --install-extension ms-vscode.azurecli +code --install-extension ms-vscode.csharp +code --install-extension fknop.vscode-npm +code --install-extension alefragnani.project-manager +code --install-extension xabikos.javascriptsnippets +code --install-extension christian-kohler.npm-intellisense +code --install-extension robertohuertasm.vscode-icons +code --install-extension eg2.tslint +code --install-extension ms-vsliveshare.vsliveshare + + +# Disable Xbox Gamebar +Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name AppCaptureEnabled -Type DWord -Value 0 +Set-ItemProperty -Path "HKCU:\System\GameConfigStore" -Name GameDVR_Enabled -Type DWord -Value 0 + +# Turn off People in Taskbar +If (-Not (Test-Path "HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People")) { + New-Item -Path HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People | Out-Null +} +Set-ItemProperty -Path "HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People" -Name PeopleBand -Type DWord -Value 0 + + + +#--- Remove windows "features" +# 3D Builder +Get-AppxPackage Microsoft.3DBuilder | Remove-AppxPackage + +# Bing Weather, News, Sports, and Finance (Money): +Get-AppxPackage Microsoft.BingFinance | Remove-AppxPackage +Get-AppxPackage Microsoft.BingNews | Remove-AppxPackage +Get-AppxPackage Microsoft.BingSports | Remove-AppxPackage +Get-AppxPackage Microsoft.BingWeather | Remove-AppxPackage + +# BubbleWitch +Get-AppxPackage *BubbleWitch* | Remove-AppxPackage + +# Candy Crush +Get-AppxPackage king.com.CandyCrush* | Remove-AppxPackage +Get-AppxPackage flaregamesGmbH.RoyalRevolt2 | Remove-AppxPackage + +Get-AppxPackage *FarmVille2CountryEscape* | Remove-AppxPackage +Get-AppxPackage *Facebook* | Remove-AppxPackage +Get-AppxPackage *MicrosoftSolitaireCollection* | Remove-AppxPackage +Get-AppxPackage *MSPaint* | Remove-AppxPackage +Get-AppxPackage *Netflix* | Remove-AppxPackage +Get-AppxPackage *photos* | Remove-AppxPackage +Get-AppxPackage *PandoraMediaInc* | Remove-AppxPackage +Get-AppxPackage *solitairecollection* | Remove-AppxPackage +Get-AppxPackage *Twitter* | Remove-AppxPackage +Get-AppxPackage *XboxSpeechToTextOverlay* | Remove-AppxPackage +Get-AppxPackage *XboxOneSmartGlass* | Remove-AppxPackage +Get-AppxPackage *xboxapp* | Remove-AppxPackage +# Zune Music, Movies & TV +Get-AppxPackage Microsoft.ZuneMusic | Remove-AppxPackage +Get-AppxPackage Microsoft.ZuneVideo | Remove-AppxPackage +# March of Empires +Get-AppxPackage *MarchofEmpires* | Remove-AppxPackage +# Skype (Metro version) +Get-AppxPackage Microsoft.SkypeApp | Remove-AppxPackage +# Disney Magic Kingdom +Get-AppxPackage *DisneyMagicKingdom* | Remove-AppxPackage + +# Hidden City: Hidden Object Adventure +Get-AppxPackage *HiddenCityMysteryofShadows* | Remove-AppxPackage + + +#--- grabbing latest UWP Samples off Github --- +RefreshEnv +cd $env:USERPROFILE\desktop +mkdir UwpSamples + +# installing Windows Template Studio VSIX + + + +# Privacy: Let apps use my advertising ID: Disable +If (-Not (Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) { + New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo | Out-Null +} +Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0 + +# WiFi Sense: HotSpot Sharing: Disable +If (-Not (Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) { + New-Item -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting | Out-Null +} +Set-ItemProperty -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting -Name value -Type DWord -Value 0 + +# WiFi Sense: Shared HotSpot Auto-Connect: Disable +Set-ItemProperty -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots -Name value -Type DWord -Value 0 + +# Start Menu: Disable Bing Search Results +Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name BingSearchEnabled -Type DWord -Value 0 + + + +#--- reenabling critial items --- +Enable-UAC +Enable-MicrosoftUpdate +Install-WindowsUpdate -acceptEula \ No newline at end of file From 15ef22a57ebce52e4101db1871cb7f84fc281681 Mon Sep 17 00:00:00 2001 From: Rob Hux Date: Sat, 9 Jun 2018 14:51:01 -0400 Subject: [PATCH 02/11] vscode key bindings --- vscode-keybindings.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 vscode-keybindings.json diff --git a/vscode-keybindings.json b/vscode-keybindings.json new file mode 100644 index 00000000..cce787a1 --- /dev/null +++ b/vscode-keybindings.json @@ -0,0 +1,7 @@ +// Place your key bindings in this file to overwrite the defaults +[ + {"key": "ctrl+d", "command": "editor.action.copyLinesDownAction", "when": "editorTextFocus"}, + {"key": "alt+enter", "command": "editor.action.quickFix", "when": "editorTextFocus"}, + {"key": "alt+f7", "command": "editor.action.referenceSearch.trigger", "when": "editorTextFocus"}, + {"key": "ctrl+alt+n", "command": "workbench.action.quickOpen"} +] \ No newline at end of file From 343619524c34baa9b39aeebe01731e77869fbb03 Mon Sep 17 00:00:00 2001 From: Rob Hux Date: Sat, 9 Jun 2018 16:15:18 -0400 Subject: [PATCH 03/11] hopefully this works as an initial script --- README.md | 16 +- array-base-VS.vssettings | 248 +++++ cmder-configs/ConEmu.xml | 862 +++++++++++++++ cmder-configs/Scripts/LSPadded.ps1 | 41 + cmder-configs/Scripts/New-CommandWrapper.ps1 | 345 ++++++ cmder-configs/Scripts/Write-Color-LS.ps1 | 55 + cmder-configs/Write-Color-LS.ps1 | 59 + cmder-configs/settings | 116 ++ cmder-configs/user-ConEmu.xml | 1015 ++++++++++++++++++ cmder-configs/user-profile.ps1 | 264 +++++ cmder-configs/vendor-profile.ps1 | 185 ++++ dev_array.ps1 | 70 +- gitsettings/.gitconfig | 66 ++ vscode-settings.json | 10 + 14 files changed, 3332 insertions(+), 20 deletions(-) create mode 100644 array-base-VS.vssettings create mode 100644 cmder-configs/ConEmu.xml create mode 100644 cmder-configs/Scripts/LSPadded.ps1 create mode 100644 cmder-configs/Scripts/New-CommandWrapper.ps1 create mode 100644 cmder-configs/Scripts/Write-Color-LS.ps1 create mode 100644 cmder-configs/Write-Color-LS.ps1 create mode 100644 cmder-configs/settings create mode 100644 cmder-configs/user-ConEmu.xml create mode 100644 cmder-configs/user-profile.ps1 create mode 100644 cmder-configs/vendor-profile.ps1 create mode 100644 gitsettings/.gitconfig create mode 100644 vscode-settings.json diff --git a/README.md b/README.md index 796d0177..41c50bd9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ +#for array + + Install my tools! + + + # About this project The goal of this project is to provide a central place to share ideas for streamlining dev box setup and provide sample scripts for common dev scenarios. It's likely you will want to take the scripts here and modify them to fit your particular needs. When you make those changes if you think others would benefit please consider submitting a PR. Before you contribute please see the [Contribution Guidelines](CONTRIBUTING.md). @@ -14,16 +20,6 @@ Before you begin, please read the [Legal](#Legal) section. To run a setup script, click a link in the table below from your target machine. This will download Boxstarter, and prompt you for Boxstarter to run with Administrator privileges (which it needs to do its job). Clicking yes in this dialog will cause the script to begin. You can then leave the job unattended and come back when it's finished. -|Click link to run |Description | -|---------|---------| -|Desktop App | Windows Desktop App Development (Visual Studio, Windows SDK) | -|Web | Web (VS Code, WSL, Multiple Browsers) | -|Web NodeJS | Web Dev with NodeJS (Web + NodeJS LTS)¹ | -|Machine Learning| Machine Learning (Python, WSL, VS Code) | -| | Xamarin (Visual Studio, Xamarin, Android SDK) | -| | Containers (Docker, Kubernetes, etc...) | -| | More Coming Soon! | - **Notes:** ¹ If you're a Node.js contributor working on Node.js core, please see the [Node.js Bootstrapping Guide](https://github.com/nodejs/node/tree/master/tools/bootstrap) or [click here to run](http://boxstarter.org/package/nr/url?https://raw.githubusercontent.com/nodejs/node/master/tools/bootstrap/windows_boxstarter). diff --git a/array-base-VS.vssettings b/array-base-VS.vssettings new file mode 100644 index 00000000..e56b2263 --- /dev/null +++ b/array-base-VS.vssettings @@ -0,0 +1,248 @@ +56553510truetruetruetruefalsetrue104false602truetruetruetrue2truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse2truetruetruetrue<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" />0110<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" />11<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" />11<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" />00101<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" />0110111<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" />10000<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" />00000<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><NamingPreferencesInfo SerializationVersion="4"> + <SymbolSpecifications> + <SymbolSpecification ID="5c545a62-b14d-460a-88d8-e936c0a39316" Name="Class"> + <ApplicableSymbolKindList> + <TypeKind>Class</TypeKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="23d856b4-5089-4405-83ce-749aada99153" Name="Interface"> + <ApplicableSymbolKindList> + <TypeKind>Interface</TypeKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="d1796e78-ff66-463f-8576-eb46416060c0" Name="Struct"> + <ApplicableSymbolKindList> + <TypeKind>Struct</TypeKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="d8af8dc6-1ade-441d-9947-8946922e198a" Name="Enum"> + <ApplicableSymbolKindList> + <TypeKind>Enum</TypeKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="408a3347-b908-4b54-a954-1355e64c1de3" Name="Delegate"> + <ApplicableSymbolKindList> + <TypeKind>Delegate</TypeKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="830657f6-e7e5-4830-b328-f109d3b6c165" Name="Event"> + <ApplicableSymbolKindList> + <SymbolKind>Event</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="390caed4-f0a9-42bb-adbb-b44c4a302a22" Name="Method"> + <ApplicableSymbolKindList> + <SymbolKind>Method</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="af410767-f189-47c6-b140-aeccf1ff242e" Name="Private Method"> + <ApplicableSymbolKindList> + <SymbolKind>Method</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Private</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="8076757e-6a4a-47f1-9b4b-ae8a3284e987" Name="Abstract Method"> + <ApplicableSymbolKindList> + <SymbolKind>Method</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList> + <ModifierKind>IsAbstract</ModifierKind> + </RequiredModifierList> + </SymbolSpecification> + <SymbolSpecification ID="16133061-a8e7-4392-92c3-1d93cd54c218" Name="Static Method"> + <ApplicableSymbolKindList> + <SymbolKind>Method</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList> + <ModifierKind>IsStatic</ModifierKind> + </RequiredModifierList> + </SymbolSpecification> + <SymbolSpecification ID="da6a2919-5aa6-4ad1-a24d-576776ed3974" Name="Property"> + <ApplicableSymbolKindList> + <SymbolKind>Property</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="b24a91ce-3501-4799-b6df-baf044156c83" Name="Public or Protected Field"> + <ApplicableSymbolKindList> + <SymbolKind>Field</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="70af42cb-1741-4027-969c-9edc4877d965" Name="Static Field"> + <ApplicableSymbolKindList> + <SymbolKind>Field</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList> + <ModifierKind>IsStatic</ModifierKind> + </RequiredModifierList> + </SymbolSpecification> + <SymbolSpecification ID="10790aa6-0a0b-432d-a52d-d252ca92302b" Name="Private or Internal Field"> + <ApplicableSymbolKindList> + <SymbolKind>Field</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="ac995be4-88de-4771-9dcc-a456a7c02d89" Name="Private or Internal Static Field"> + <ApplicableSymbolKindList> + <SymbolKind>Field</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList> + <ModifierKind>IsStatic</ModifierKind> + </RequiredModifierList> + </SymbolSpecification> + <SymbolSpecification ID="2c07f5bf-bc81-4c2b-82b4-ae9b3ffd0ba4" Name="Types"> + <ApplicableSymbolKindList> + <TypeKind>Class</TypeKind> + <TypeKind>Struct</TypeKind> + <TypeKind>Interface</TypeKind> + <TypeKind>Enum</TypeKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + <SymbolSpecification ID="5f3ddba1-279f-486c-801e-5c097c36dd85" Name="Non-Field Members"> + <ApplicableSymbolKindList> + <SymbolKind>Property</SymbolKind> + <SymbolKind>Method</SymbolKind> + <SymbolKind>Event</SymbolKind> + </ApplicableSymbolKindList> + <ApplicableAccessibilityList> + <AccessibilityKind>Public</AccessibilityKind> + <AccessibilityKind>Internal</AccessibilityKind> + <AccessibilityKind>Private</AccessibilityKind> + <AccessibilityKind>Protected</AccessibilityKind> + <AccessibilityKind>ProtectedOrInternal</AccessibilityKind> + </ApplicableAccessibilityList> + <RequiredModifierList /> + </SymbolSpecification> + </SymbolSpecifications> + <NamingStyles> + <NamingStyle ID="87e7c501-9948-4b53-b1eb-a6cbe918feee" Name="Pascal Case" Prefix="" Suffix="" WordSeparator="" CapitalizationScheme="PascalCase" /> + <NamingStyle ID="1ecc5eb6-b5fc-49a5-a9f1-a980f3e48c92" Name="Begins with I" Prefix="I" Suffix="" WordSeparator="" CapitalizationScheme="PascalCase" /> + </NamingStyles> + <NamingRules> + <SerializableNamingRule SymbolSpecificationID="23d856b4-5089-4405-83ce-749aada99153" NamingStyleID="1ecc5eb6-b5fc-49a5-a9f1-a980f3e48c92" EnforcementLevel="Info" /> + <SerializableNamingRule SymbolSpecificationID="2c07f5bf-bc81-4c2b-82b4-ae9b3ffd0ba4" NamingStyleID="87e7c501-9948-4b53-b1eb-a6cbe918feee" EnforcementLevel="Info" /> + <SerializableNamingRule SymbolSpecificationID="5f3ddba1-279f-486c-801e-5c097c36dd85" NamingStyleID="87e7c501-9948-4b53-b1eb-a6cbe918feee" EnforcementLevel="Info" /> + </NamingRules> +</NamingPreferencesInfo>1001111000<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" />012<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" />11<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" />00000110<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" />10011<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Hidden" />121<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="true" DiagnosticSeverity="Info" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" />011<CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" /><CodeStyleOption SerializationVersion="1" Type="Boolean" Value="false" DiagnosticSeverity="Hidden" />011011000101114truetruetruetrue2truetruefalsefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrue16244681013027014130030571648769114413810003575607202202157245271502431557746900202000-1-17257087123839990128jpg080gif99915000-12083886085-1750-11317273516765887200-1-104294967295201001128954521521676031116750848210033012865075201800-114145511216768975072570870text/html;text/x-jquery-tmpl;text/template;text/x-handlebars;text/x-handlebars-template;text/x-jsrender1673925816777215090HTML5010500-120111190170100112167508481200-14truetruetruetrue2truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrue2truetruetruetrue2truetruefalsefalsefalsetruetruefalsetruetruetrue58truefalse2truetruetruetrue4truetruetruetrue2truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruetruetrue + false + true + true + true + true + + true + true + true + false + true + true + true + false + false + true + true + 4truetruetruetrue2truetruetruefalsefalsetruetruefalsefalsetruetrue58truefalse4truetruetruetruefalsefalsefalsefalsetruetruefalsetruefalsetruefalsetruetruefalsetruefalsefalsefalsefalsetruefalsetruefalsetruefalsefalsetruefalsefalsetrue{}[]().,:;+-*/%&|^!~=<>? falsefalsetrue2TrueFalseTrueTrueTrueTrueTrueTrueTrueTrueOffTrueSemi-expandedTrueTrueOffFalsehttp://schemastore.org/api/json/catalog.json.\node_modules\.bin;$(VSINSTALLDIR)\Web\External;$(PATH);$(VSINSTALLDIR)\Web\External\git;$(DevEnvDir)\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin \ No newline at end of file diff --git a/cmder-configs/ConEmu.xml b/cmder-configs/ConEmu.xml new file mode 100644 index 00000000..c238cc0c --- /dev/null +++ b/cmder-configs/ConEmu.xml @@ -0,0 +1,862 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cmder-configs/Scripts/LSPadded.ps1 b/cmder-configs/Scripts/LSPadded.ps1 new file mode 100644 index 00000000..7c83f12f --- /dev/null +++ b/cmder-configs/Scripts/LSPadded.ps1 @@ -0,0 +1,41 @@ +function LS-Padded +{ + param ($dir) + Get-Childitem $dir + Write-Host + getDirSize $dir +} + +function getDirSize +{ + param ($dir) + $bytes = 0 + + Get-Childitem $dir | foreach-object { + + if ($_ -is [System.IO.FileInfo]) + { + $bytes += $_.Length + } + } + + if ($bytes -ge 1KB -and $bytes -lt 1MB) + { + Write-Host ("Total Size: " + [Math]::Round(($bytes / 1KB), 2) + " KB") + } + + elseif ($bytes -ge 1MB -and $bytes -lt 1GB) + { + Write-Host ("Total Size: " + [Math]::Round(($bytes / 1MB), 2) + " MB") + } + + elseif ($bytes -ge 1GB) + { + Write-Host ("Total Size: " + [Math]::Round(($bytes / 1GB), 2) + " GB") + } + + else + { + Write-Host ("Total Size: " + $bytes + " bytes") + } +} \ No newline at end of file diff --git a/cmder-configs/Scripts/New-CommandWrapper.ps1 b/cmder-configs/Scripts/New-CommandWrapper.ps1 new file mode 100644 index 00000000..e4567b3b --- /dev/null +++ b/cmder-configs/Scripts/New-CommandWrapper.ps1 @@ -0,0 +1,345 @@ +############################################################################## +## +## New-CommandWrapper +## +## From Windows PowerShell Cookbook (O'Reilly) +## by Lee Holmes (http://www.leeholmes.com/guide) +## +############################################################################## + +<# + +.SYNOPSIS + +Adds parameters and functionality to existing cmdlets and functions. + +.EXAMPLE + +New-CommandWrapper Get-Process ` + -AddParameter @{ + SortBy = { + $newPipeline = { + __ORIGINAL_COMMAND__ | Sort-Object -Property $SortBy + } + } + } + +This example adds a 'SortBy' parameter to Get-Process. It accomplishes +this by adding a Sort-Object command to the pipeline. + +.EXAMPLE + +$parameterAttributes = @' + [Parameter(Mandatory = $true)] + [ValidateRange(50,75)] + [Int] +'@ + +New-CommandWrapper Clear-Host ` + -AddParameter @{ + @{ + Name = 'MyMandatoryInt'; + Attributes = $parameterAttributes + } = { + Write-Host $MyMandatoryInt + Read-Host "Press ENTER" + } + } + +This example adds a new mandatory 'MyMandatoryInt' parameter to +Clear-Host. This parameter is also validated to fall within the range +of 50 to 75. It doesn't alter the pipeline, but does display some +information on the screen before processing the original pipeline. + +#> + +param( + ## The name of the command to extend + [Parameter(Mandatory = $true)] + $Name, + + ## Script to invoke before the command begins + [ScriptBlock] $Begin, + + ## Script to invoke for each input element + [ScriptBlock] $Process, + + ## Script to invoke at the end of the command + [ScriptBlock] $End, + + ## Parameters to add, and their functionality. + ## + ## The Key of the hashtable can be either a simple parameter name, + ## or a more advanced parameter description. + ## + ## If you want to add additional parameter validation (such as a + ## parameter type,) then the key can itself be a hashtable with the keys + ## 'Name' and 'Attributes'. 'Attributes' is the text you would use when + ## defining this parameter as part of a function. + ## + ## The Value of each hashtable entry is a scriptblock to invoke + ## when this parameter is selected. To customize the pipeline, + ## assign a new scriptblock to the $newPipeline variable. Use the + ## special text, __ORIGINAL_COMMAND__, to represent the original + ## command. The $targetParameters variable represents a hashtable + ## containing the parameters that will be passed to the original + ## command. + [HashTable] $AddParameter +) + +Set-StrictMode -Version Latest + +## Store the target command we are wrapping, and its command type +$target = $Name +$commandType = "Cmdlet" + +## If a function already exists with this name (perhaps it's already been +## wrapped,) rename the other function and chain to its new name. +if(Test-Path function:\$Name) +{ + $target = "$Name" + "-" + [Guid]::NewGuid().ToString().Replace("-","") + Rename-Item function:\GLOBAL:$Name GLOBAL:$target + $commandType = "Function" +} + +## The template we use for generating a command proxy +$proxy = @' + +__CMDLET_BINDING_ATTRIBUTE__ +param( +__PARAMETERS__ +) +begin +{ + try { + __CUSTOM_BEGIN__ + + ## Access the REAL Foreach-Object command, so that command + ## wrappers do not interfere with this script + $foreachObject = $executionContext.InvokeCommand.GetCmdlet( + "Microsoft.PowerShell.Core\Foreach-Object") + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand( + '__COMMAND_NAME__', + [System.Management.Automation.CommandTypes]::__COMMAND_TYPE__) + + ## TargetParameters represents the hashtable of parameters that + ## we will pass along to the wrapped command + $targetParameters = @{} + $PSBoundParameters.GetEnumerator() | + & $foreachObject { + if($command.Parameters.ContainsKey($_.Key)) + { + $targetParameters.Add($_.Key, $_.Value) + } + } + + ## finalPipeline represents the pipeline we wil ultimately run + $newPipeline = { & $wrappedCmd @targetParameters } + $finalPipeline = $newPipeline.ToString() + + __CUSTOM_PARAMETER_PROCESSING__ + + $steppablePipeline = [ScriptBlock]::Create( + $finalPipeline).GetSteppablePipeline() + $steppablePipeline.Begin($PSCmdlet) + } catch { + throw + } +} + +process +{ + try { + __CUSTOM_PROCESS__ + $steppablePipeline.Process($_) + } catch { + throw + } +} + +end +{ + try { + __CUSTOM_END__ + $steppablePipeline.End() + } catch { + throw + } +} + +dynamicparam +{ + ## Access the REAL Get-Command, Foreach-Object, and Where-Object + ## commands, so that command wrappers do not interfere with this script + $getCommand = $executionContext.InvokeCommand.GetCmdlet( + "Microsoft.PowerShell.Core\Get-Command") + $foreachObject = $executionContext.InvokeCommand.GetCmdlet( + "Microsoft.PowerShell.Core\Foreach-Object") + $whereObject = $executionContext.InvokeCommand.GetCmdlet( + "Microsoft.PowerShell.Core\Where-Object") + + ## Find the parameters of the original command, and remove everything + ## else from the bound parameter list so we hide parameters the wrapped + ## command does not recognize. + $command = & $getCommand __COMMAND_NAME__ -Type __COMMAND_TYPE__ + $targetParameters = @{} + $PSBoundParameters.GetEnumerator() | + & $foreachObject { + if($command.Parameters.ContainsKey($_.Key)) + { + $targetParameters.Add($_.Key, $_.Value) + } + } + + ## Get the argumment list as it would be passed to the target command + $argList = @($targetParameters.GetEnumerator() | + Foreach-Object { "-$($_.Key)"; $_.Value }) + + ## Get the dynamic parameters of the wrapped command, based on the + ## arguments to this command + $command = $null + try + { + $command = & $getCommand __COMMAND_NAME__ -Type __COMMAND_TYPE__ ` + -ArgumentList $argList + } + catch + { + + } + + $dynamicParams = @($command.Parameters.GetEnumerator() | + & $whereObject { $_.Value.IsDynamic }) + + ## For each of the dynamic parameters, add them to the dynamic + ## parameters that we return. + if ($dynamicParams.Length -gt 0) + { + $paramDictionary = ` + New-Object Management.Automation.RuntimeDefinedParameterDictionary + foreach ($param in $dynamicParams) + { + $param = $param.Value + $arguments = $param.Name, $param.ParameterType, $param.Attributes + $newParameter = ` + New-Object Management.Automation.RuntimeDefinedParameter ` + $arguments + $paramDictionary.Add($param.Name, $newParameter) + } + return $paramDictionary + } +} + +<# + +.ForwardHelpTargetName __COMMAND_NAME__ +.ForwardHelpCategory __COMMAND_TYPE__ + +#> + +'@ + +## Get the information about the original command +$originalCommand = Get-Command $target +$metaData = New-Object System.Management.Automation.CommandMetaData ` + $originalCommand +$proxyCommandType = [System.Management.Automation.ProxyCommand] + +## Generate the cmdlet binding attribute, and replace information +## about the target +$proxy = $proxy.Replace("__CMDLET_BINDING_ATTRIBUTE__", + $proxyCommandType::GetCmdletBindingAttribute($metaData)) +$proxy = $proxy.Replace("__COMMAND_NAME__", $target) +$proxy = $proxy.Replace("__COMMAND_TYPE__", $commandType) + +## Stores new text we'll be putting in the param() block +$newParamBlockCode = "" + +## Stores new text we'll be putting in the begin block +## (mostly due to parameter processing) +$beginAdditions = "" + +## If the user wants to add a parameter +$currentParameter = $originalCommand.Parameters.Count +if($AddParameter) +{ + foreach($parameter in $AddParameter.Keys) + { + ## Get the code associated with this parameter + $parameterCode = $AddParameter[$parameter] + + ## If it's an advanced parameter declaration, the hashtable + ## holds the validation and / or type restrictions + if($parameter -is [Hashtable]) + { + ## Add their attributes and other information to + ## the variable holding the parameter block additions + if($currentParameter -gt 0) + { + $newParamBlockCode += "," + } + + $newParamBlockCode += "`n`n " + + $parameter.Attributes + "`n" + + ' $' + $parameter.Name + + $parameter = $parameter.Name + } + else + { + ## If this is a simple parameter name, add it to the list of + ## parameters. The proxy generation APIs will take care of + ## adding it to the param() block. + $newParameter = + New-Object System.Management.Automation.ParameterMetadata ` + $parameter + $metaData.Parameters.Add($parameter, $newParameter) + } + + $parameterCode = $parameterCode.ToString() + + ## Create the template code that invokes their parameter code if + ## the parameter is selected. + $templateCode = @" + + if(`$PSBoundParameters['$parameter']) + { + $parameterCode + + ## Replace the __ORIGINAL_COMMAND__ tag with the code + ## that represents the original command + `$alteredPipeline = `$newPipeline.ToString() + `$finalPipeline = `$alteredPipeline.Replace( + '__ORIGINAL_COMMAND__', `$finalPipeline) + } +"@ + + ## Add the template code to the list of changes we're making + ## to the begin() section. + $beginAdditions += $templateCode + $currentParameter++ + } +} + +## Generate the param() block +$parameters = $proxyCommandType::GetParamBlock($metaData) +if($newParamBlockCode) { $parameters += $newParamBlockCode } +$proxy = $proxy.Replace('__PARAMETERS__', $parameters) + +## Update the begin, process, and end sections +$proxy = $proxy.Replace('__CUSTOM_BEGIN__', $Begin) +$proxy = $proxy.Replace('__CUSTOM_PARAMETER_PROCESSING__', $beginAdditions) +$proxy = $proxy.Replace('__CUSTOM_PROCESS__', $Process) +$proxy = $proxy.Replace('__CUSTOM_END__', $End) + +## Save the function wrapper +Write-Verbose $proxy +Set-Content function:\GLOBAL:$NAME $proxy + +## If we were wrapping a cmdlet, hide it so that it doesn't conflict with +## Get-Help and Get-Command +if($commandType -eq "Cmdlet") +{ + $originalCommand.Visibility = "Private" +} \ No newline at end of file diff --git a/cmder-configs/Scripts/Write-Color-LS.ps1 b/cmder-configs/Scripts/Write-Color-LS.ps1 new file mode 100644 index 00000000..8e8d3806 --- /dev/null +++ b/cmder-configs/Scripts/Write-Color-LS.ps1 @@ -0,0 +1,55 @@ +function Write-Color-LS + { + param ([string]$color = "white", $file) + Write-host ("{0,-7} {1,25} {2,10} {3}" -f $file.mode, ([String]::Format("{0,10} {1,8}", $file.LastWriteTime.ToString("d"), $file.LastWriteTime.ToString("t"))), $file.length, $file.name) -foregroundcolor $color + } + +New-CommandWrapper Out-Default -Process { + $regex_opts = ([System.Text.RegularExpressions.RegexOptions]::IgnoreCase) + + + $compressed = New-Object System.Text.RegularExpressions.Regex( + '\.(zip|tar|gz|rar|jar|war)$', $regex_opts) + $executable = New-Object System.Text.RegularExpressions.Regex( + '\.(exe|bat|cmd|py|pl|ps1|psm1|vbs|rb|reg)$', $regex_opts) + $text_files = New-Object System.Text.RegularExpressions.Regex( + '\.(txt|cfg|conf|ini|csv|log|xml|java|c|cpp|cs)$', $regex_opts) + + if(($_ -is [System.IO.DirectoryInfo]) -or ($_ -is [System.IO.FileInfo])) + { + if(-not ($notfirst)) + { + Write-Host + Write-Host " Directory: " -noNewLine + Write-Host " $(pwd)`n" -foregroundcolor "Magenta" + Write-Host "Mode LastWriteTime Length Name" + Write-Host "---- ------------- ------ ----" + $notfirst=$true + } + + if ($_ -is [System.IO.DirectoryInfo]) + { + Write-Color-LS "Magenta" $_ + } + elseif ($compressed.IsMatch($_.Name)) + { + Write-Color-LS "DarkGreen" $_ + } + elseif ($executable.IsMatch($_.Name)) + { + Write-Color-LS "Red" $_ + } + elseif ($text_files.IsMatch($_.Name)) + { + Write-Color-LS "Yellow" $_ + } + else + { + Write-Color-LS "White" $_ + } + + $_ = $null + } +} -end { + write-host "" +} \ No newline at end of file diff --git a/cmder-configs/Write-Color-LS.ps1 b/cmder-configs/Write-Color-LS.ps1 new file mode 100644 index 00000000..3f9d2407 --- /dev/null +++ b/cmder-configs/Write-Color-LS.ps1 @@ -0,0 +1,59 @@ +#function Write-Color-LS +# { +# param ([string]$color = "white", $file) +# Write-host ("{0,-7} {1,25} {2,10} {3}" -f $file.mode, ([String]::Format("{0,10} {1,8}", $file.LastWriteTime.ToString("d"), $file.LastWriteTime.ToString("t"))), $file.length, $file.name) -foregroundcolor $color +# } + +New-CommandWrapper Out-Default -Process { + $regex_opts = ([System.Text.RegularExpressions.RegexOptions]::IgnoreCase) + $compressed = New-Object System.Text.RegularExpressions.Regex('\.(zip|tar|gz|rar|jar|war)$', $regex_opts) + $executable = New-Object System.Text.RegularExpressions.Regex('\.(exe|bat|cmd|msi|ps1|psm1|vbs|reg)$', $regex_opts) + $dll = New-Object System.Text.RegularExpressions.Regex('\.(dll)$', $regex_opts) + $text_files = New-Object System.Text.RegularExpressions.Regex('\.(txt|cfg|conf|ini|csv|log|xml|java|c|cpp|cs)$', $regex_opts) + + if(($_ -is [System.IO.DirectoryInfo]) -or ($_ -is [System.IO.FileInfo])) + { + if(-not ($notfirst)) + { + Write-Host "`n Directory: " -noNewLine + Write-Host "$(pwd)`n" -foregroundcolor "Cyan" + Write-Host "Mode Last Write Time Length Name" + Write-Host "---- --------------- ------ ----" + $notfirst=$true + } + + if ($_ -is [System.IO.DirectoryInfo]) + { + Write-Host ("{0} {1} {2}" -f $_.mode, ([String]::Format("{0,10} {1,8}", $_.LastWriteTime.ToString("d"), $_.LastWriteTime.ToString("t"))), $_.name) -ForegroundColor "Cyan" + } + else + { + if ($compressed.IsMatch($_.Name)) + { + $color = "DarkGreen" + } + elseif ($executable.IsMatch($_.Name)) + { + $color = "Red" + } elseif ($dll.IsMatch($_.Name)){ + $color = "Grey" + }elseif ($text_files.IsMatch($_.Name)) + { + $color = "Yellow" + } + else + { + $color = "White" + } + Write-Host ("{0} {1} {2,10} {3}" -f $_.mode, ([String]::Format("{0,10} {1,8}", $_.LastWriteTime.ToString("d"), $_.LastWriteTime.ToString("t"))), $_.length, $_.name) -ForegroundColor $color + } + + $_ = $null + } +} -end { + Write-Host +} + + + + diff --git a/cmder-configs/settings b/cmder-configs/settings new file mode 100644 index 00000000..12681f68 --- /dev/null +++ b/cmder-configs/settings @@ -0,0 +1,116 @@ +# name: Pressing Ctrl-D exits session +# type: bool +# Ctrl-D exits cmd.exe when it is pressed on an empty line. +ctrld_exits = 1 + +# name: Toggle if pressing Esc clears line +# type: bool +# Clink clears the current line when Esc is pressed (unless Readline's Vi mode +# is enabled). +esc_clears_line = 1 + +# name: Match display colour +# type: int +# Colour to use when displaying matches. A value less than 0 will be the +# opposite brightness of the default colour. +match_colour = -1 + +# name: Executable match style +# type: enum +# 0 = PATH only +# 1 = PATH and CWD +# 2 = PATH, CWD, and directories +# Changes how Clink will match executables when there is no path separator on +# the line. 0 = PATH only, 1 = PATH and CWD, 2 = PATH, CWD, and directories. In +# all cases both executables and directories are matched when there is a path +# separator present. A value of -1 will disable executable matching completely. +exec_match_style = 2 + +# name: Whitespace prefix matches files +# type: bool +# If the line begins with whitespace then Clink bypasses executable matching and +# will match all files and directories instead. +space_prefix_match_files = 1 + +# name: Colour of the prompt +# type: int +# Surrounds the prompt in ANSI escape codes to set the prompt's colour. Disabled +# when the value is less than 0. +prompt_colour = -1 + +# name: Auto-answer terminate prompt +# type: enum +# 0 = Disabled +# 1 = Answer 'Y' +# 2 = Answer 'N' +# Automatically answers cmd.exe's 'Terminate batch job (Y/N)?' prompts. 0 = +# disabled, 1 = answer 'Y', 2 = answer 'N'. +terminate_autoanswer = 0 + +# name: Lines of history saved to disk +# type: int +# When set to a positive integer this is the number of lines of history that +# will persist when Clink saves the command history to disk. Use 0 for infinite +# lines and <0 to disable history persistence. +history_file_lines = 10000 + +# name: Skip adding lines prefixed with whitespace +# type: bool +# Ignore lines that begin with whitespace when adding lines in to the history. +history_ignore_space = 0 + +# name: Controls how duplicate entries are handled +# type: enum +# 0 = Always add +# 1 = Ignore +# 2 = Erase previous +# If a line is a duplicate of an existing history entry Clink will erase the +# duplicate when this is set 2. A value of 1 will not add duplicates to the +# history and a value of 0 will always add lines. Note that history is not +# deduplicated when reading/writing to disk. +history_dupe_mode = 2 + +# name: Read/write history file each line edited +# type: bool +# When non-zero the history will be read from disk before editing a new line and +# written to disk afterwards. +history_io = 0 + +# name: Sets how command history expansion is applied +# type: enum +# 0 = Off +# 1 = On +# 2 = Not in single quotes +# 3 = Not in double quote +# 4 = Not in any quotes +# The '!' character in an entered line can be interpreted to introduce words +# from the history. This can be enabled and disable by setting this value to 1 +# or 0. Values or 2, 3 or 4 will skip any ! character quoted in single, double, +# or both quotes respectively. +history_expand_mode = 4 + +# name: Support Windows' Ctrl-Alt substitute for AltGr +# type: bool +# Windows provides Ctrl-Alt as a substitute for AltGr, historically to support +# keyboards with no AltGr key. This may collide with some of Readline's +# bindings. +use_altgr_substitute = 1 + +# name: Strips CR and LF chars on paste +# type: enum +# 0 = Paste unchanged +# 1 = Strip +# 2 = As space +# Setting this to a value >0 will make Clink strip CR and LF characters from +# text pasted into the current line. Set this to 1 to strip all newline +# characters and 2 to replace them with a space. +strip_crlf_on_paste = 2 + +# name: Enables basic ANSI escape code support +# type: bool +# When printing the prompt, Clink has basic built-in support for SGR ANSI escape +# codes to control the text colours. This is automatically disabled if a third +# party tool is detected that also provides this facility. It can also be +# disabled by setting this to 0. +ansi_code_support = 1 + diff --git a/cmder-configs/user-ConEmu.xml b/cmder-configs/user-ConEmu.xml new file mode 100644 index 00000000..9c021e5d --- /dev/null +++ b/cmder-configs/user-ConEmu.xml @@ -0,0 +1,1015 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cmder-configs/user-profile.ps1 b/cmder-configs/user-profile.ps1 new file mode 100644 index 00000000..bb2c769f --- /dev/null +++ b/cmder-configs/user-profile.ps1 @@ -0,0 +1,264 @@ +# Use this file to run your own startup commands + +## Prompt Customization +<# +.SYNTAX + + λ +.EXAMPLE + N:\Documents\src\cmder [master] + λ | +#> + +[ScriptBlock]$PrePrompt = { + +} + +[ScriptBlock]$CmderPrompt = { + Update-NavigationHistory $pwd.Path + $Host.UI.RawUI.ForegroundColor = "White" + Microsoft.PowerShell.Utility\Write-Host '[' -NoNewLine -ForegroundColor Gray + Microsoft.PowerShell.Utility\Write-Host $(Get-History).Count -NoNewLine -ForegroundColor DarkGray + Microsoft.PowerShell.Utility\Write-Host '] ' -NoNewLine -ForegroundColor Gray + $maxPathLength = 75 + $curPath = $pwd.ProviderPath + if ($curPath.ToLower().StartsWith($Home.ToLower())) + { + $curPath = "~" + $curPath.SubString($Home.Length) + } + if ($curPath.Length -gt $maxPathLength) { + $index = $curPath.IndexOf('\', $curPath.IndexOf('\') + 1) + 1; + #$curPath = '...' + $curPath.SubString($curPath.Length - $maxPathLength + 3) + $curPath = $curPath.Substring(0, $index) + '.....' + $curPath.Substring($curPath.Length - $maxPathLength + ($index + 5)); + } + + Microsoft.PowerShell.Utility\Write-Host $curPath -NoNewLine -ForegroundColor Green + checkGit($pwd.ProviderPath) +} + + + +[ScriptBlock]$PostPrompt = { + +} + +if ($host.Name -eq 'ConsoleHost') +{ + Import-Module PSReadline +} + +Import-Module z +Import-Module posh-docker + +## + +#pushd 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools' +#cmd /c "vsvars32.bat&set" | +#foreach { +# if ($_ -match "=") { +# $v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])" +# } +#} +#popd +#write-host "`nVisual Studio 2015 Command Prompt variables set." -ForegroundColor Yellow + +$MaximumHistoryCount = 4KB +$historyPath = Join-Path (split-path $profile) PowerShellHistory.csv + +Remove-Item Alias:Curl +Remove-Item Alias:WGet + +if (Test-path $historyPath) +{ + Import-CSV $historyPath | ? {$_.CommandLine -ne "Invoke-Expression '. ''C:\tools\cmder\vendor\conemu-maximus5\..\profile.ps1'''"} | ? {$_.CommandLine -ne "exit"} | ? {$_.CommandLine -ne "h"} | ? {$_.CommandLine -ne "ls"} | ? {$_.CommandLine -ne "fd"} | ? {$count++;$true} | Add-History + Write-Host -Fore Green "`nLoaded $count history item(s).`n" +} + +# Hook powershell's exiting event & hide the registration with -supportevent (from nivot.org) +Register-EngineEvent -SourceIdentifier powershell.exiting -SupportEvent -Action { + Get-History -Count $MaximumHistoryCount | ? {$_.CommandLine -ne "Invoke-Expression '. ''C:\tools\cmder\vendor\conemu-maximus5\..\profile.ps1'''"} | Export-CSV -Path $historyPath + exit +}.GetNewClosure() + +#Set-Alias bash 'C:\Windows\System32\bash.exe' -cur_console:p1 +Set-Alias note 'C:\Program Files\Notepad++\notepad++.exe' +Set-Alias sqll 'C:\Program Files (x86)\SqliteBrowser3\bin\sqlitebrowser.exe' +Set-Alias .. Set-ParentUp +Set-Alias ... Set-ParentUps +Set-Alias dev Set-Code +Set-Alias ppath Print-Path +Set-Alias gs Do-Git-Status +Set-Alias gd Do-Git-Diff +Set-Alias fd Open-Path-Here +Set-Alias clean Clean-Bins +Set-Alias sh Create-Console +#Set-Alias sha Create-Console-Admin +Set-Alias z Search-NavigationHistory + +$env:Path += ";$(Split-Path $profile)\Scripts" + +function Create-Console($path = $(pwd)) { + PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:$path +} + +function Set-ParentUp { + Set-Location .. +} +function Print-Path { + ($env:Path).Replace(';',"`n") +} + +function Set-ParentUps { + Set-Location .. + Set-Location .. +} + +function Do-Git-Status { + git st +} +function Do-Git-Diff($file) { + git diff $file +} + + +function Set-Code($code) { + if($code -eq $null) { + Set-Location 'C:\Array' + } elseif ($code.ToLower().CompareTo('array') -eq 0) { + Set-Location 'C:\Array' + } elseif ($code.ToLower().CompareTo('github') -eq 0) { + Set-Location 'C:\GitHub' + } elseif ($code.ToLower().CompareTo('git') -eq 0) { + Set-Location 'C:\GitHub' + } +} + + +function Open-Path-Here { + ii . +} + +function Clean-Bins { + Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { + Write-Host " Removing: $_" + remove-item $_.fullname -Force -Recurse + } +} + + +New-CommandWrapper Out-Default -Process { + $regex_opts = ([System.Text.RegularExpressions.RegexOptions]::IgnoreCase) + $compressed = New-Object System.Text.RegularExpressions.Regex('\.(zip|tar|gz|rar|jar|war)$', $regex_opts) + $executable = New-Object System.Text.RegularExpressions.Regex('\.(exe|bat|cmd|msi|ps1|psm1|vbs|reg|sh)$', $regex_opts) + $dll = New-Object System.Text.RegularExpressions.Regex('\.(dll)$', $regex_opts) + $text_files = New-Object System.Text.RegularExpressions.Regex('\.(txt|cfg|conf|ini|csv|log|xml|json|config|xproj|md)$', $regex_opts) + $array_files = New-Object System.Text.RegularExpressions.Regex('\.(cs|ts|js|java|c|cpp|html)$', $regex_opts) + + if(($_ -is [System.IO.DirectoryInfo]) -or ($_ -is [System.IO.FileInfo])) + { + if(-not ($notfirst)) + { + Write-Host "`n Directory: " -noNewLine + Write-Host "$(pwd)`n" -foregroundcolor "Cyan" + Write-Host "Mode Last Write Time Length Name" + Write-Host "---- --------------- ------ ----" + $notfirst=$true + } + + if ($_ -is [System.IO.DirectoryInfo]) + { + Write-Host ("{0} {1} {2}" -f $_.mode, ([String]::Format("{0,10} {1,8}", $_.LastWriteTime.ToString("d"), $_.LastWriteTime.ToString("t"))), $_.name) -ForegroundColor "Cyan" + } + else + { + if ($compressed.IsMatch($_.Name)) + { + $color = "DarkGreen" + } + elseif ($executable.IsMatch($_.Name)) { + $color = "Red" + } elseif ($dll.IsMatch($_.Name)) { + $color = "DarkGray" + } elseif ($text_files.IsMatch($_.Name)) { + $color = "Yellow" + } elseif ($array_files.IsMatch($_.Name)) { + $color = "DarkCyan" + } else { + $color = "White" + } + Write-Host ("{0} {1} {2,10} {3}" -f $_.mode, ([String]::Format("{0,10} {1,8}", $_.LastWriteTime.ToString("d"), $_.LastWriteTime.ToString("t"))), $_.length, $_.name) -ForegroundColor $color + } + + $_ = $null + } +} -end { + Write-Host +} + +function Get-DirSize +{ + param ($dir) + $bytes = 0 + $count = 0 + + Get-Childitem $dir -Force | Foreach-Object { + if ($_ -is [System.IO.FileInfo]) + { + $bytes += $_.Length + $count++ + } + } + + Write-Host "`n " -NoNewline + + if ($bytes -ge 1KB -and $bytes -lt 1MB) + { + Write-Host ("" + [Math]::Round(($bytes / 1KB), 2) + " KB") -ForegroundColor "White" -NoNewLine + } + elseif ($bytes -ge 1MB -and $bytes -lt 1GB) + { + Write-Host ("" + [Math]::Round(($bytes / 1MB), 2) + " MB") -ForegroundColor "White" -NoNewLine + } + elseif ($bytes -ge 1GB) + { + Write-Host ("" + [Math]::Round(($bytes / 1GB), 2) + " GB") -ForegroundColor "White" -NoNewLine + } + else + { + Write-Host ("" + $bytes + " bytes") -ForegroundColor "White" -NoNewLine + } + Write-Host " in " -NoNewline + Write-Host $count -ForegroundColor "White" -NoNewline + Write-Host " files" + +} + +function Get-DirWithSize +{ + param ($dir) + Get-Childitem $dir -Force + Get-DirSize $dir +} + +Remove-Item alias:dir +Remove-Item alias:ls +Set-Alias dir Get-DirWithSize +Set-Alias ls Get-DirWithSize + +function Prompt { + Update-NavigationHistory $pwd.Path +} + +Import-Module 'C:\tools\poshgit\dahlbyk-posh-git-9bda399\src\posh-git.psd1' + + +$GitPromptSettings.DefaultPromptAbbreviateHomeDirectory = $true +#$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" +#if (Test-Path($ChocolateyProfile)) { +# Import-Module "$ChocolateyProfile" +#} +$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" +if (Test-Path($ChocolateyProfile)) { + Import-Module "$ChocolateyProfile" +} + diff --git a/cmder-configs/vendor-profile.ps1 b/cmder-configs/vendor-profile.ps1 new file mode 100644 index 00000000..f81788a4 --- /dev/null +++ b/cmder-configs/vendor-profile.ps1 @@ -0,0 +1,185 @@ +# Init Script for PowerShell +# Created as part of cmder project + +# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED +# !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands + +# Compatibility with PS major versions <= 2 +if(!$PSScriptRoot) { + $PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path +} + +# We do this for Powershell as Admin Sessions because CMDER_ROOT is not beng set. +if (! $ENV:CMDER_ROOT ) { + if ( $ENV:ConEmuDir ) { + $ENV:CMDER_ROOT = resolve-path( $ENV:ConEmuDir + "\..\.." ) + } else { + $ENV:CMDER_ROOT = resolve-path( $PSScriptRoot + "\.." ) + } +} + +# Remove trailing '\' +$ENV:CMDER_ROOT = (($ENV:CMDER_ROOT).trimend("\")) + +# do not load bundled psget if a module installer is already available +# -> recent PowerShell versions include PowerShellGet out of the box +$moduleInstallerAvailable = [bool](Get-Command -Name 'Install-Module' -ErrorAction SilentlyContinue | Out-Null) + +# Add Cmder modules directory to the autoload path. +$CmderModulePath = Join-path $PSScriptRoot "psmodules/" + +if(-not $moduleInstallerAvailable -and -not $env:PSModulePath.Contains($CmderModulePath) ){ + $env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;") +} + +try { + Get-command -Name "vim" -ErrorAction Stop >$null +} catch { + # # You could do this but it may be a little drastic and introduce a lot of + # # unix tool overlap with powershel unix like aliases + # $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\usr\bin") + # set-alias -name "vi" -value "vim" + # # I think the below is safer. + + new-alias -name "vim" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe") + new-alias -name "vi" -value vim +} + +try { + # Check if git is on PATH, i.e. Git already installed on system + Get-command -Name "git" -ErrorAction Stop >$null +} catch { + $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\cmd") + # for bash.exe, which in the cmd version is found as \usr\bin\bash.exe + $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\bin") +} + +$gitLoaded = $false +function Import-Git($Loaded){ + if($Loaded) { return } + $GitModule = Get-Module -Name Posh-Git -ListAvailable + if($GitModule | select version | where version -le ([version]"0.6.1.20160330")){ + Import-Module Posh-Git > $null + } + if(-not ($GitModule) ) { + Write-Warning "Missing git support, install posh-git with 'Install-Module posh-git' and restart cmder." + } + # Make sure we only run once by alawys returning true + return $true +} + +function checkGit($Path) { + if (Test-Path -Path (Join-Path $Path '.git') ) { + $gitLoaded = Import-Git $gitLoaded + Write-VcsStatus + return + } + $SplitPath = split-path $path + if ($SplitPath) { + checkGit($SplitPath) + } +} + +if (Get-Module PSReadline -ErrorAction "SilentlyContinue") { + Set-PSReadlineOption -ExtraPromptLineCount 1 +} + +# Enhance Path +$env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT" + +# +# Prompt Section +# Users should modify their user-profile.ps1 as it will be safe from updates. +# + +# Pre assign the hooks so the first run of cmder gets a working prompt. +[ScriptBlock]$PrePrompt = {} +[ScriptBlock]$PostPrompt = {} +[ScriptBlock]$CmderPrompt = { + $Host.UI.RawUI.ForegroundColor = "White" + Microsoft.PowerShell.Utility\Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green + checkGit($pwd.ProviderPath) +} + +<# +This scriptblock runs every time the prompt is returned. +Explicitly use functions from MS namespace to protect from being overridden in the user session. +Custom prompt functions are loaded in as constants to get the same behaviour +#> +[ScriptBlock]$Prompt = { + $realLASTEXITCODE = $LASTEXITCODE + $host.UI.RawUI.WindowTitle = Microsoft.PowerShell.Management\Split-Path $pwd.ProviderPath -Leaf + PrePrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline + CmderPrompt + Microsoft.PowerShell.Utility\Write-Host "`n[" -NoNewLine -ForegroundColor Gray + Microsoft.PowerShell.Utility\Write-Host $(Get-History).Count -NoNewLine -ForegroundColor DarkGray + Microsoft.PowerShell.Utility\Write-Host '] ' -NoNewLine -ForegroundColor Gray + Microsoft.PowerShell.Utility\Write-Host "∧ " -NoNewLine -ForegroundColor "DarkCyan" + PostPrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline + $global:LASTEXITCODE = $realLASTEXITCODE + return " " +} + +# Drop *.ps1 files into "$ENV:CMDER_ROOT\config\profile.d" +# to source them at startup. +if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) { + mkdir "$ENV:CMDER_ROOT\config\profile.d" +} + +pushd $ENV:CMDER_ROOT\config\profile.d +foreach ($x in Get-ChildItem *.ps1) { + # write-host write-host Sourcing $x + . $x +} +popd + +$CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1" +if(Test-Path $CmderUserProfilePath) { + # Create this file and place your own command in there. + . "$CmderUserProfilePath" +} else { +# This multiline string cannot be indented, for this reason I've not indented the whole block + +Write-Host -BackgroundColor Darkgreen -ForegroundColor White "First Run: Creating user startup file: $CmderUserProfilePath" + +$UserProfileTemplate = @' +# Use this file to run your own startup commands + +## Prompt Customization +<# +.SYNTAX + + λ +.EXAMPLE + N:\Documents\src\cmder [master] + λ | +#> + +[ScriptBlock]$PrePrompt = { + +} + +# Replace the cmder prompt entirely with this. +# [ScriptBlock]$CmderPrompt = {} + +[ScriptBlock]$PostPrompt = { + +} + +## + + +'@ + +New-Item -ItemType File -Path $CmderUserProfilePath -Value $UserProfileTemplate > $null + +} + +# Once Created these code blocks cannot be overwritten +Set-Item -Path function:\PrePrompt -Value $PrePrompt -Options Constant +Set-Item -Path function:\CmderPrompt -Value $CmderPrompt -Options Constant +Set-Item -Path function:\PostPrompt -Value $PostPrompt -Options Constant + +# Functions can be made constant only at creation time +# ReadOnly at least requires `-force` to be overwritten +Set-Item -Path function:\prompt -Value $Prompt -Options ReadOnly diff --git a/dev_array.ps1 b/dev_array.ps1 index 6476ab9b..0e86d7c8 100644 --- a/dev_array.ps1 +++ b/dev_array.ps1 @@ -7,7 +7,6 @@ Disable-UAC #--- Windows Subsystems/Features --- choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures choco install -y Microsoft-Hyper-V-All -source windowsFeatures -#choco install -y docker-for-windows #--- Configuring Windows properties --- #--- Windows Features --- @@ -28,8 +27,33 @@ Set-ItemProperty -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\ Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense -Value 1 #--- Ubuntu --- -Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.appx -UseBasicParsing +#Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Ubuntu.appx -UseBasicParsing +#Add-AppxPackage -Path ~/Ubuntu.appx +#-- set up folder paths +if (!(Test-Path -Path C:\Array )) { + mkdir C:\Array +} + +if (!(Test-Path -Path C:\Tools )) { + mkdir C:\Tools +} + +if (!(Test-Path -Path C:\Array\vso )) { + mkdir C:\Array\vso +} + +if (!(Test-Path -Path C:\Array\plastic )) { + mkdir C:\Array\platic +} + +if (!(Test-Path -Path C:\Array\plastic\central )) { + mkdir C:\Array\platic\central +} + +if (!(Test-Path -Path C:\Array\plastic\local )) { + mkdir C:\Array\platic\local +} #--- VS 2017 uwp and azure workloads + git tools --- # See this for install args: https://chocolatey.org/packages/VisualStudio2017Professional @@ -46,10 +70,12 @@ RefreshEnv choco install -y git -params '"/GitOnlyOnPath /WindowsTerminal"' RefreshEnv +# fonts +choco install -y inconsolata FiraCode choco install -y googlechrome Firefox RefreshEnv -choco install -y 7zip 7zip.install curl cmder FiraCode kdiff3 keepass keepass.instal nodejs nodejs.install paint.net notepadplusplus notepadplusplus.install poshgit +choco install -y 7zip 7zip.install curl cmder kdiff3 keepass nodejs paint.net notepadplusplus poshgit microsoft-teams choco install -y SourceTree resharper sysinternals yarn RefreshEnv @@ -72,6 +98,36 @@ code --install-extension robertohuertasm.vscode-icons code --install-extension eg2.tslint code --install-extension ms-vsliveshare.vsliveshare +#-- set up folder paths +if (!(Test-Path -Path C:\Temp )) { + mkdir C:\Temp +} + + +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/vscode-keybindings.json" -OutFile "$env:APPDATA/Code/User/keybindings.json" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/vscode-settings.json" -OutFile "$env:APPDATA/Code/User/settings.json" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/array-base-VS.vssettings" -OutFile "C:/Temp/User/array-base-VS.vssettings" + +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/LSPadded.ps1" -OutFile "C:/tools/cmder/config/Scripts/LSPadded.ps1" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/New-CommandWrapper.ps1" -OutFile "C:/tools/cmder/config/Scripts/New-CommandWrapper.ps1" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/Write-Color-LS.ps1" -OutFile "C:/tools/cmder/config/Scripts/Write-Color-LS.ps1" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/ConEmu.xml" -OutFile "C:/tools/cmder/config/ConEmu.xml" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/settings" -OutFile "C:/tools/cmder/config/settings" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/user-ConEmu.xml" -OutFile "C:/tools/cmder/config/user-ConEmu.xml" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/user-profile.ps1" -OutFile "C:/tools/cmder/config/user-profile.ps1" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Write-Color-LS.ps1" -OutFile "C:/tools/cmder/config/Write-Color-LS.ps1" +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/vendor-profile.ps1" -OutFile "C:/tools/cmder/vendor/profile.ps1" + +#need to figure out how to install vsix +# https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ASPNETCoreTemplatePack20173 +# https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebExtensionPack2017 +# https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer +# https://marketplace.visualstudio.com/items?itemName=MadsKristensen.NPMTaskRunner +# https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ignore +# https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProductivityPowerPack2017 + + + # Disable Xbox Gamebar Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR" -Name AppCaptureEnabled -Type DWord -Value 0 @@ -128,13 +184,6 @@ Get-AppxPackage *DisneyMagicKingdom* | Remove-AppxPackage Get-AppxPackage *HiddenCityMysteryofShadows* | Remove-AppxPackage -#--- grabbing latest UWP Samples off Github --- -RefreshEnv -cd $env:USERPROFILE\desktop -mkdir UwpSamples - -# installing Windows Template Studio VSIX - # Privacy: Let apps use my advertising ID: Disable @@ -156,6 +205,7 @@ Set-ItemProperty -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\Allow Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name BingSearchEnabled -Type DWord -Value 0 +devenv /ResetSettings "C:/Temp/User/array-base-VS.vssettings" #--- reenabling critial items --- Enable-UAC diff --git a/gitsettings/.gitconfig b/gitsettings/.gitconfig new file mode 100644 index 00000000..c79353f8 --- /dev/null +++ b/gitsettings/.gitconfig @@ -0,0 +1,66 @@ +[alias] + up = "!git remote update -p; git merge --ff-only @{u}" + p = pull --rebase + pu = "!git fetch origin -v; git fetch upstream -v; git merge upstream/master" + st = status -s + a = add + ap = add -p + aa = !git add -u && git add . && git st + c = commit --verbose + cm = commit -m + ca = commit --amend -C HEAD + co = checkout + cob = checkout -b + br = branch + un = reset --soft HEAD~ + last = log -1 HEAD + logtree = log --graph --oneline --decorate --all + ls = log --pretty=format:%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]--decorate + ll = log --pretty=format:%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]--decorate --numstat + ld = log --pretty=format:%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]--decorate --date=relative + lnc = log --pretty=format:%h\\ %s\\ [%cn] + squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f" + dl = !git ll -1 + dlc = diff --cached HEAD^ + filelog = log -u + fl = log -u + dr = "!f() { git diff $1^..$1; }; f" + lc = "!f() { git ll $1^..$1; }; f" + diffr = "!f() { git diff $1^..$1; }; f" + b = !git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--' + la = !git config -l | grep alias | cut -c 7- + f = !git ls-files | grep -i + grep = grep -Ii + gr = grep -Ii + gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f" + open = !explorer `git config remote.origin.url` + browse = !git open + hh = push heroku heroku +[gui] +[push] + default = matching + followTags = true +[merge] + tool = kdiff3 +[mergetool "kdiff3"] + path = C:/Program Files/KDiff3/kdiff3.exe +[diff] + tool = kdiff3 + guitool = kdiff3 +[difftool "kdiff3"] + path = C:/Program Files/KDiff3/kdiff3.exe +[http] + postBuffer = 157286400 +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + required = true + process = git-lfs filter-process +[url "https://github"] + insteadOf = git://github +[core] + autocrlf = true +[pack] + window = 0 +[credential] + helper = manager diff --git a/vscode-settings.json b/vscode-settings.json new file mode 100644 index 00000000..43be7d1c --- /dev/null +++ b/vscode-settings.json @@ -0,0 +1,10 @@ +// Place your settings in this file to overwrite the default settings +{ + "editor.fontFamily": "Fira Code, Consolas, 'Courier New', monospace", + "editor.fontSize": 14, + "editor.fontLigatures": true, + "editor.tabSize": 2, + "workbench.iconTheme": "vscode-icons", + "vsicons.dontShowNewVersionMessage": true, + "team.showWelcomeMessage": false +} \ No newline at end of file From 81aa4f2be0705a6d88bf59f10aa129c583af3dff Mon Sep 17 00:00:00 2001 From: Rob Hux Date: Sat, 9 Jun 2018 16:47:02 -0400 Subject: [PATCH 04/11] added npm installs --- dev_array.ps1 | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/dev_array.ps1 b/dev_array.ps1 index 0e86d7c8..d6970edc 100644 --- a/dev_array.ps1 +++ b/dev_array.ps1 @@ -98,16 +98,36 @@ code --install-extension robertohuertasm.vscode-icons code --install-extension eg2.tslint code --install-extension ms-vsliveshare.vsliveshare + +npm install -g aurelia-cli@0.31.3 +npm install -g autorest +npm install -g bower +npm install -g dts +npm install -g yo generator-aspnet generator-docker +npm install -g gulp gulp-cli gulp-notify +npm install -g grunt grunt-cli +npm install -g jspm@0.16.53 +npm install -g npm-windows-upgrade +npm install -g semistandard +npm install -g ts-node +npm install -g swagger-cli +npm install -g typescript@2.8.1 +npm install -g typings@2.1.1 + + #-- set up folder paths if (!(Test-Path -Path C:\Temp )) { mkdir C:\Temp } - +# set up vscode settings Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/vscode-keybindings.json" -OutFile "$env:APPDATA/Code/User/keybindings.json" Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/vscode-settings.json" -OutFile "$env:APPDATA/Code/User/settings.json" + +# set up vs studio base settings (basically fonts and files binds) Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/array-base-VS.vssettings" -OutFile "C:/Temp/User/array-base-VS.vssettings" +# setup Cmder Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/LSPadded.ps1" -OutFile "C:/tools/cmder/config/Scripts/LSPadded.ps1" Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/New-CommandWrapper.ps1" -OutFile "C:/tools/cmder/config/Scripts/New-CommandWrapper.ps1" Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/Write-Color-LS.ps1" -OutFile "C:/tools/cmder/config/Scripts/Write-Color-LS.ps1" @@ -118,6 +138,10 @@ Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/window Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Write-Color-LS.ps1" -OutFile "C:/tools/cmder/config/Write-Color-LS.ps1" Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/vendor-profile.ps1" -OutFile "C:/tools/cmder/vendor/profile.ps1" +# setup git +Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/gitsettings/.gitconfig" -OutFile "$env:USERPROFILE/.gitconfig" + + #need to figure out how to install vsix # https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ASPNETCoreTemplatePack20173 # https://marketplace.visualstudio.com/items?itemName=MadsKristensen.WebExtensionPack2017 From e98efa36b718b450df70fea418acd3d317ccf692 Mon Sep 17 00:00:00 2001 From: Rob Hux Date: Sat, 9 Jun 2018 16:47:18 -0400 Subject: [PATCH 05/11] fixed gitalias --- gitsettings/.gitconfig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gitsettings/.gitconfig b/gitsettings/.gitconfig index c79353f8..50212ff9 100644 --- a/gitsettings/.gitconfig +++ b/gitsettings/.gitconfig @@ -1,7 +1,6 @@ [alias] up = "!git remote update -p; git merge --ff-only @{u}" p = pull --rebase - pu = "!git fetch origin -v; git fetch upstream -v; git merge upstream/master" st = status -s a = add ap = add -p @@ -11,13 +10,14 @@ ca = commit --amend -C HEAD co = checkout cob = checkout -b - br = branch + br = branch -vv un = reset --soft HEAD~ last = log -1 HEAD + lt = log --graph --oneline --decorate --all logtree = log --graph --oneline --decorate --all - ls = log --pretty=format:%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]--decorate - ll = log --pretty=format:%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]--decorate --numstat - ld = log --pretty=format:%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]--decorate --date=relative + ls = log --pretty=format:%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn] --decorate + ll = log --pretty=format:%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn] --decorate --numstat + ld = log --pretty=format:%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn] --decorate --date=relative lnc = log --pretty=format:%h\\ %s\\ [%cn] squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f" dl = !git ll -1 From ead0d1e75334308177fc3344421df66d399e271e Mon Sep 17 00:00:00 2001 From: Rob Hux Date: Sat, 9 Jun 2018 16:49:47 -0400 Subject: [PATCH 06/11] added comment --- dev_array.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_array.ps1 b/dev_array.ps1 index d6970edc..542e1fee 100644 --- a/dev_array.ps1 +++ b/dev_array.ps1 @@ -149,7 +149,7 @@ Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/window # https://marketplace.visualstudio.com/items?itemName=MadsKristensen.NPMTaskRunner # https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ignore # https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProductivityPowerPack2017 - +# and this: http://mike-ward.net/vscoloroutput/ From 16695a80aac41968f53e6650364b193d04dc9e15 Mon Sep 17 00:00:00 2001 From: Rob Hux Date: Sat, 9 Jun 2018 17:09:52 -0400 Subject: [PATCH 07/11] adding templates --- dev_array.ps1 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dev_array.ps1 b/dev_array.ps1 index 542e1fee..cf9c88e6 100644 --- a/dev_array.ps1 +++ b/dev_array.ps1 @@ -75,7 +75,7 @@ choco install -y inconsolata FiraCode choco install -y googlechrome Firefox RefreshEnv -choco install -y 7zip 7zip.install curl cmder kdiff3 keepass nodejs paint.net notepadplusplus poshgit microsoft-teams +choco install -y 7zip 7zip.install curl cmder kdiff3 keepass nodejs paint.net notepadplusplus poshgit microsoft-teams jdk8 choco install -y SourceTree resharper sysinternals yarn RefreshEnv @@ -113,7 +113,7 @@ npm install -g ts-node npm install -g swagger-cli npm install -g typescript@2.8.1 npm install -g typings@2.1.1 - +npm install -g selenium-standalone #-- set up folder paths if (!(Test-Path -Path C:\Temp )) { @@ -229,8 +229,20 @@ Set-ItemProperty -Path HKLM:\Software\Microsoft\PolicyManager\default\WiFi\Allow Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search -Name BingSearchEnabled -Type DWord -Value 0 +# install the temp settings devenv /ResetSettings "C:/Temp/User/array-base-VS.vssettings" +#install templates for dotnetnew +dotnet new --install "Microsoft.AspNetCore.SpaTemplates" +dotnet new --install "Microsoft.DotNet.Web.Spa.ProjectTemplates" +dotnet new --install "IdentityServer4.Templates" +dotnet new --install "Boilerplate.Templates" +dotnet new --install "Microsoft.AspNetCore.Blazor.Templates" +dotnet new --install "MadsKristensen.AspNetCore.Web.Templates::*" + +# this requires interaction +choco install notepadreplacer + #--- reenabling critial items --- Enable-UAC Enable-MicrosoftUpdate From 0623cd20f9f6de8a2bfa6deda04446eb7540ce7c Mon Sep 17 00:00:00 2001 From: Robert Hux Date: Mon, 8 Apr 2019 09:55:35 -0400 Subject: [PATCH 08/11] removed versions --- dev_array.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dev_array.ps1 b/dev_array.ps1 index cf9c88e6..836f0239 100644 --- a/dev_array.ps1 +++ b/dev_array.ps1 @@ -99,20 +99,20 @@ code --install-extension eg2.tslint code --install-extension ms-vsliveshare.vsliveshare -npm install -g aurelia-cli@0.31.3 +npm install -g aurelia-cli npm install -g autorest npm install -g bower npm install -g dts npm install -g yo generator-aspnet generator-docker npm install -g gulp gulp-cli gulp-notify npm install -g grunt grunt-cli -npm install -g jspm@0.16.53 +npm install -g jspm npm install -g npm-windows-upgrade npm install -g semistandard npm install -g ts-node npm install -g swagger-cli -npm install -g typescript@2.8.1 -npm install -g typings@2.1.1 +npm install -g typescript +npm install -g typings npm install -g selenium-standalone #-- set up folder paths @@ -246,4 +246,4 @@ choco install notepadreplacer #--- reenabling critial items --- Enable-UAC Enable-MicrosoftUpdate -Install-WindowsUpdate -acceptEula \ No newline at end of file +Install-WindowsUpdate -acceptEula From 681ec8ab555e603c5e1ad687bf76144934c58dfa Mon Sep 17 00:00:00 2001 From: Robert Hux Date: Mon, 8 Apr 2019 09:58:51 -0400 Subject: [PATCH 09/11] added slack --- dev_array.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev_array.ps1 b/dev_array.ps1 index 836f0239..e9cea275 100644 --- a/dev_array.ps1 +++ b/dev_array.ps1 @@ -68,7 +68,7 @@ RefreshEnv choco install -y KB2919355 KB2919442 KB2999226 KB3033929 KB3035131 chocolatey-windowsupdate.extension chocolatey-core.extension vcredist140 vcredist2010 vcredist2015 RefreshEnv -choco install -y git -params '"/GitOnlyOnPath /WindowsTerminal"' +choco install -y git --package-parameters="'/GitOnlyOnPath /WindowsTerminal'" RefreshEnv # fonts choco install -y inconsolata FiraCode @@ -76,7 +76,7 @@ choco install -y googlechrome Firefox RefreshEnv choco install -y 7zip 7zip.install curl cmder kdiff3 keepass nodejs paint.net notepadplusplus poshgit microsoft-teams jdk8 -choco install -y SourceTree resharper sysinternals yarn +choco install -y SourceTree resharper sysinternals yarn slack RefreshEnv choco install -y visualstudiocode From bce3b71089fb20fed4466b5a766f9466e9be23f7 Mon Sep 17 00:00:00 2001 From: Robert Hux Date: Mon, 8 Apr 2019 10:03:38 -0400 Subject: [PATCH 10/11] more updates --- dev_array.ps1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dev_array.ps1 b/dev_array.ps1 index e9cea275..4e1ea23b 100644 --- a/dev_array.ps1 +++ b/dev_array.ps1 @@ -5,8 +5,8 @@ Disable-UAC #--- Windows Subsystems/Features --- -choco install -y Microsoft-Windows-Subsystem-Linux -source windowsfeatures -choco install -y Microsoft-Hyper-V-All -source windowsFeatures +choco install -y Microsoft-Windows-Subsystem-Linux --source="'windowsfeatures'" +choco install -y Microsoft-Hyper-V-All --source="'windowsfeatures'" #--- Configuring Windows properties --- #--- Windows Features --- @@ -97,6 +97,8 @@ code --install-extension christian-kohler.npm-intellisense code --install-extension robertohuertasm.vscode-icons code --install-extension eg2.tslint code --install-extension ms-vsliveshare.vsliveshare +code --install-extension msjsdiag.debugger-for-chrome +code --install-extension msjsdiag.debugger-for-edge npm install -g aurelia-cli @@ -243,6 +245,15 @@ dotnet new --install "MadsKristensen.AspNetCore.Web.Templates::*" # this requires interaction choco install notepadreplacer +Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Ubuntu.appx -UseBasicParsing +Add-AppxPackage -Path ~/Ubuntu.appx + +RefreshEnv +Ubuntu1804 install --root +Ubuntu1804 run apt update +Ubuntu1804 run apt upgrade -y + + #--- reenabling critial items --- Enable-UAC Enable-MicrosoftUpdate From a485629345511a97104b26139cb979057aaa0cd7 Mon Sep 17 00:00:00 2001 From: Robert Hux Date: Wed, 27 May 2020 15:45:17 -0400 Subject: [PATCH 11/11] Update dev_array.ps1 tweaking --- dev_array.ps1 | 56 +++++++++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/dev_array.ps1 b/dev_array.ps1 index 4e1ea23b..dc4641d1 100644 --- a/dev_array.ps1 +++ b/dev_array.ps1 @@ -43,23 +43,23 @@ if (!(Test-Path -Path C:\Array\vso )) { mkdir C:\Array\vso } -if (!(Test-Path -Path C:\Array\plastic )) { - mkdir C:\Array\platic -} +#if (!(Test-Path -Path C:\Array\plastic )) { +# mkdir C:\Array\platic +#} -if (!(Test-Path -Path C:\Array\plastic\central )) { - mkdir C:\Array\platic\central -} +#if (!(Test-Path -Path C:\Array\plastic\central )) { +# mkdir C:\Array\platic\central +#} -if (!(Test-Path -Path C:\Array\plastic\local )) { - mkdir C:\Array\platic\local -} +#if (!(Test-Path -Path C:\Array\plastic\local )) { +# mkdir C:\Array\platic\local +#} #--- VS 2017 uwp and azure workloads + git tools --- # See this for install args: https://chocolatey.org/packages/VisualStudio2017Professional # https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-community # https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio#list-of-workload-ids-and-component-ids -choco install -y visualstudio2017professional --package-parameters "--add Microsoft.VisualStudio.Workload.CoreEditor --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.NetCoreTools --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.Net.ComponentGroup.TargetingPacks.Common --add Microsoft.Component.Azure.DataLake.Tools --add Microsoft.VisualStudio.Component.Azure.ResourceManager.Tools --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices --add Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.ComponentGroup.Web.CloudTools --add Microsoft.VisualStudio.Component.AppInsights.Tools --add Microsoft.VisualStudio.Component.Wcf.Tooling --add Microsoft.Net.Component.4.6.2.SDK --add Microsoft.Net.Component.4.7.SDK --add Microsoft.Net.Component.4.7.1.SDK --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.Component.4.7.TargetingPack --add Microsoft.Net.Component.4.7.1.TargetingPack --add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools --add Microsoft.VisualStudio.Component.Azure.Storage.AzCopy --add Microsoft.VisualStudio.Component.AspNet45 --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.Component.Azure.Waverton --add Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools --add Microsoft.VisualStudio.Component.TypeScript.2.1 --add Microsoft.VisualStudio.Component.TypeScript.2.2 --add Microsoft.VisualStudio.Component.TypeScript.2.5 --add Microsoft.VisualStudio.Component.TypeScript.2.6 --add Microsoft.VisualStudio.Component.TestTools.Core --add Microsoft.VisualStudio.Component.Git --remove Component.Redgate.SQLSearch.VSExtension --remove Component.Dotfuscator --remove Microsoft.ComponentGroup.Blend --remove Microsoft.Component.HelpViewer" +choco install -y visualstudio2019professional --package-parameters "--add Microsoft.VisualStudio.Workload.CoreEditor --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.NetCoreTools --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.Net.ComponentGroup.TargetingPacks.Common --add Microsoft.Component.Azure.DataLake.Tools --add Microsoft.VisualStudio.Component.Azure.ResourceManager.Tools --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices --add Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.ComponentGroup.Web.CloudTools --add Microsoft.VisualStudio.Component.AppInsights.Tools --add Microsoft.VisualStudio.Component.Wcf.Tooling --add Microsoft.Net.Component.4.6.2.SDK --add Microsoft.Net.Component.4.7.SDK --add Microsoft.Net.Component.4.7.1.SDK --add Microsoft.Net.Component.4.6.2.TargetingPack --add Microsoft.Net.Component.4.7.TargetingPack --add Microsoft.Net.Component.4.7.1.TargetingPack --add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.DeveloperTools --add Microsoft.Net.ComponentGroup.4.7.1.DeveloperTools --add Microsoft.VisualStudio.Component.Azure.Storage.AzCopy --add Microsoft.VisualStudio.Component.AspNet45 --add Microsoft.VisualStudio.Component.DiagnosticTools --add Microsoft.VisualStudio.Component.Azure.Waverton --add Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools --add Microsoft.VisualStudio.Component.TypeScript.2.1 --add Microsoft.VisualStudio.Component.TypeScript.2.2 --add Microsoft.VisualStudio.Component.TypeScript.2.5 --add Microsoft.VisualStudio.Component.TypeScript.2.6 --add Microsoft.VisualStudio.Component.TestTools.Core --add Microsoft.VisualStudio.Component.Git --remove Component.Redgate.SQLSearch.VSExtension --remove Component.Dotfuscator --remove Microsoft.ComponentGroup.Blend --remove Microsoft.Component.HelpViewer" RefreshEnv choco install chocolatey-visualstudio.extension @@ -75,23 +75,23 @@ choco install -y inconsolata FiraCode choco install -y googlechrome Firefox RefreshEnv -choco install -y 7zip 7zip.install curl cmder kdiff3 keepass nodejs paint.net notepadplusplus poshgit microsoft-teams jdk8 +choco install -y 7zip 7zip.install curl kdiff3 keepass nodejs paint.net notepadplusplus poshgit choco install -y SourceTree resharper sysinternals yarn slack RefreshEnv choco install -y visualstudiocode RefreshEnv -code --install-extension aureliaeffect.aurelia -code --install-extension behzad88.aurelia +#code --install-extension aureliaeffect.aurelia +#code --install-extension behzad88.aurelia code --install-extension steoates.autoimport code --install-extension jerryhong.autofilename code --install-extension ms-vscode.azure-account -code --install-extension ms-azuretools.vscode-azureappservice +#code --install-extension ms-azuretools.vscode-azureappservice code --install-extension ms-vscode.azurecli code --install-extension ms-vscode.csharp code --install-extension fknop.vscode-npm -code --install-extension alefragnani.project-manager +#code --install-extension alefragnani.project-manager code --install-extension xabikos.javascriptsnippets code --install-extension christian-kohler.npm-intellisense code --install-extension robertohuertasm.vscode-icons @@ -101,7 +101,7 @@ code --install-extension msjsdiag.debugger-for-chrome code --install-extension msjsdiag.debugger-for-edge -npm install -g aurelia-cli +#npm install -g aurelia-cli npm install -g autorest npm install -g bower npm install -g dts @@ -123,22 +123,22 @@ if (!(Test-Path -Path C:\Temp )) { } # set up vscode settings -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/vscode-keybindings.json" -OutFile "$env:APPDATA/Code/User/keybindings.json" -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/vscode-settings.json" -OutFile "$env:APPDATA/Code/User/settings.json" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/vscode-keybindings.json" -OutFile "$env:APPDATA/Code/User/keybindings.json" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/vscode-settings.json" -OutFile "$env:APPDATA/Code/User/settings.json" # set up vs studio base settings (basically fonts and files binds) -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/array-base-VS.vssettings" -OutFile "C:/Temp/User/array-base-VS.vssettings" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/array-base-VS.vssettings" -OutFile "C:/Temp/User/array-base-VS.vssettings" # setup Cmder -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/LSPadded.ps1" -OutFile "C:/tools/cmder/config/Scripts/LSPadded.ps1" -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/New-CommandWrapper.ps1" -OutFile "C:/tools/cmder/config/Scripts/New-CommandWrapper.ps1" -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/Write-Color-LS.ps1" -OutFile "C:/tools/cmder/config/Scripts/Write-Color-LS.ps1" -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/ConEmu.xml" -OutFile "C:/tools/cmder/config/ConEmu.xml" -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/settings" -OutFile "C:/tools/cmder/config/settings" -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/user-ConEmu.xml" -OutFile "C:/tools/cmder/config/user-ConEmu.xml" -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/user-profile.ps1" -OutFile "C:/tools/cmder/config/user-profile.ps1" -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Write-Color-LS.ps1" -OutFile "C:/tools/cmder/config/Write-Color-LS.ps1" -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/vendor-profile.ps1" -OutFile "C:/tools/cmder/vendor/profile.ps1" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/LSPadded.ps1" -OutFile "C:/tools/cmder/config/Scripts/LSPadded.ps1" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/New-CommandWrapper.ps1" -OutFile "C:/tools/cmder/config/Scripts/New-CommandWrapper.ps1" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Scripts/Write-Color-LS.ps1" -OutFile "C:/tools/cmder/config/Scripts/Write-Color-LS.ps1" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/ConEmu.xml" -OutFile "C:/tools/cmder/config/ConEmu.xml" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/settings" -OutFile "C:/tools/cmder/config/settings" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/user-ConEmu.xml" -OutFile "C:/tools/cmder/config/user-ConEmu.xml" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/user-profile.ps1" -OutFile "C:/tools/cmder/config/user-profile.ps1" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/Write-Color-LS.ps1" -OutFile "C:/tools/cmder/config/Write-Color-LS.ps1" +#Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/cmder-configs/vendor-profile.ps1" -OutFile "C:/tools/cmder/vendor/profile.ps1" # setup git Invoke-WebRequest -Uri "https://raw.githubusercontent.com/array-analytics/windows-dev-box-setup-scripts/master/gitsettings/.gitconfig" -OutFile "$env:USERPROFILE/.gitconfig"