Skip to content

Instantly share code, notes, and snippets.

@kthjm
Last active March 15, 2019 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kthjm/16e4a3feb3827fd9e3219febafe5bf6e to your computer and use it in GitHub Desktop.
Save kthjm/16e4a3feb3827fd9e3219febafe5bf6e to your computer and use it in GitHub Desktop.
# chcp 65001
# start-process: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/start-process?view=powershell-6
# sal: http://yanor.net/wiki/?PowerShell/%E3%82%B7%E3%82%A7%E3%83%AB%E7%AE%A1%E7%90%86/%E3%82%A8%E3%82%A4%E3%83%AA%E3%82%A2%E3%82%B9%20-%20Set-Alias%20Get-Alias%E4%BB%96
sal vs code
function churl($url) { start "chrome" -ArgumentList "$url" }
function ch:google() {
$query = [system.String]::Join("+", $args)
$url = "https://www.google.com/search?q=" + $query
churl $url
}
function ch:github($user, $repo) {
$url = "https://github.com"
if ($user) {
$url = $url + "/" + $user
if ($repo) {
$url = $url + "/" + $repo
}
}
churl $url
}
function ch:yarn($query) {
$url = "https://yarnpkg.com/en/packages?q=" + $query
churl $url
}
sal gg ch:google
sal gh ch:github
sal ya ch:yarn
function chapsdir() {
$dir_programs = "C:\Users\kthjm\AppData\Roaming\Microsoft\Windows\Start Menu\Programs"
$programs_pattern_chrome = ls $dir_programs | sls -Pattern "Chrome"
$dir_apps = $dir_programs + "\" + $programs_pattern_chrome[0]
return $dir_apps
}
function chaps() { chapsdir | ls }
function chap($name) {
$dir = chapsdir
$path = $dir + "\" + $name + ".lnk"
$is_invoke = test-path $path
if ($is_invoke) {
ii $path
} else {
$msg = $name + " is not existed"
echo $msg
}
}
function chooslr() { chap "chooslr" }
function nhentai() { chap "nhentai" }
function line() { chap "line" }
function chapsasnow() {
$now = get-date
$apps = chaps
foreach($file in $apps) { $file.LastWriteTime = $now }
}
# function chap($id) {
# start "chrome" -ArgumentList "--profile-directory=Default --app-id=$id"
# }
#
# function chooslr() {
# chap("hiedjgldmkagkgffnfedmenmleoecdfk")
# }
#
# function line() {
# chap("pbpoojghcbigbheeamegjbdailkaeglf")
# }

Install Chocolatey

Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

from Install with PowerShell.exe

cinst hyper --yes

Then edit .hyper.js

// shell: '',
// shellArgs: ['--login'],
shell: 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe',
shellArgs: [],

yarn => nvm => node/npm

cinst yarn -y --ignore-dependencies
cinst nvm -y
nvm install 8.11.1
nvm install 9.11.1
nvm use 8.11.1

use --ignore-dependencies to avoid install node.

Document how to install yarn when you use nvm

I think there's an --ignore-dependencies flag

cinst atom -y

packages

cinst ruby -y
gem install travis -v 1.8.8 --no-rdoc --no-ri

others

directly

set enviroment variables

  1. コントロール パネル\システムとセキュリティ\システム
  2. システムの詳細設定
  3. 環境変数
  4. システム環境変数 => Path => 参照
@kthjm
Copy link
Author

kthjm commented Mar 15, 2019

メインのpowershellからbashを呼び出して使う。

  • apex
  • up
  • docker

このあたりのpowershell世界ではやっていくのが心もとないプログラムをbashから使う。

@kthjm
Copy link
Author

kthjm commented Mar 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment