- Php7
- Composer
- Gulp
- Npm
- Vagrant
- Virtual Box
- Laravel Installer
| #region Elevate | |
| function Elevate { | |
| <# | |
| .SYNOPSIS | |
| Automatically (re)launch Powershell script as Administrator including parameters | |
| .PARAMETER ScriptPath | |
| Path to the script that should be launched. Defaults to the current script | |
| .PARAMETER Parameters | |
| A Hashtable of parameters that should be passed to the elevated script, where the "key" is the | |
| parameter name and the "value" is the parameter value |
| #!/bin/bash | |
| mkdir -p /opt/bin | |
| curl -L `curl -s https://api.github.com/repos/docker/compose/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux") and contains("x86_64"))'` > /opt/bin/docker-compose | |
| chmod +x /opt/bin/docker-compose |
| # https://github.com/chocolatey/choco/wiki/CommandsReference#how-to-pass-options--switches | |
| # Powershell specific argument passing | |
| # You must be on the latest beta of chocolatey for this to work properly (redownload files) | |
| choco upgrade chocolatey -pre | |
| $originalPath = $env:PATH | |
| choco install ruby --version 1.9.3.55100 -my --install-arguments '/verysilent /dir=""c:\tools\ruby193"" /tasks=""assocfiles""' --override-arguments | |
| # DevKit for Ruby 1.x |
The catch is that they're only available for the duration of your session. They are, however, available in all apps across the system.
Someone asked about how to do it on Facebook this week, and at first, I just pointed them at the install script for PowerLineFonts which loops through all the fonts in a folder and install them.
I've used this more than a few times to install some fonts, including the PowerLine ones, which are great:
$sa = New-Object -ComObject Shell.ApplicationRecently when refactoring a Vue 1.0 application, I utilized ES6 arrow functions to clean up the code and make things a bit more consistent before updating to Vue 2.0. Along the way I made a few mistakes and wanted to share the lessons I learned as well as offer a few conventions that I will be using in my Vue applications moving forward.
The best way to explain this is with an example so lets start there. I'm going to throw a rather large block of code at you here, but stick with me and we will move through it a piece at a time.
<script>
// require vue-resource...
new Vue({The simplest way to enforce rules on PowerShell class properties is to set the Type of the property, of course. But sometimes you want something a little bit more clever than that. One solution is to use a Validate* attribute, like ValidateRange or ValidateLength or ValidateSet attribute...
However, you can write your own, by just deriving from ValidateArguments() or something that derives from that, like the ValidateEnumeratedArguments class allows you to validate a whole array of items.
For instance, a simple validator would be one that validates uniqueness, based on a specific property. Our validator will be created fresh each time it's used, and then each item in the array will be passed through ValidateElement, so this works:
using namespace System.Collections.Generic
usinI work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.
For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.
Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.
| function Get-EnvironmentVariablesDialog { | |
| rundll32 sysdm.cpl,EditEnvironmentVariables | |
| } | |
| Set-Alias EnvGui Get-EnvironmentVariablesDialog |