Opensourcetechブログ

OpensourcetechによるNGINX/Zabbix/Neo4j/Linuxなどオープンソース技術に関するブログです。

Mac OSへのPowerShellのインストール

こんにちは、LinuCエバンジェリストこと、鯨井貴博@opensourcetechです。

 Linusと一緒に写った画像

 

 Mac OSへのPower Shellのインストール方法の紹介です。

 

なお、brewコマンドを使いますので入っていない方は以下を参考にインストールを行ってください。

Homebrew & Python3(pip3)インストール on MacOS High Sierra - Opensourcetechブログ

 

brewでpowershellをインストール。

そのままですね。

bash-3.2$ brew cask install powershell
Updating Homebrew...
[34m==>[0m [1mAuto-updated Homebrew![0m
Updated 1 tap (homebrew/core).
[34m==>[0m [1mNew Formulae[0m
anyenv gtranslator riff
apache-arrow h3 s3ql
apache-arrow-glib homeassistant-cli sd
aws-iam-authenticator i386-elf-grub serve
bluetoothconnector jinja2-cli sha3sum
bumpversion jp signal-cli
cafeobj kcov sn0int
cassandra-reaper kubeprod solr@7.7
cmusfm libkeccak spirv-cross
cstore_fdw libopenmpt step
diskus llvm@7 stolon
dmg2img mage swagger2markup-cli
dockerize man-db tesseract-lang
fff mdbook triangle
ffsend operator-sdk ungit
git-absorb phpmd usbredir
gitleaks protoc-gen-go v2ray-plugin
gnunet pyinstaller vulkan-headers
go@1.11 re-flex zydis
grpcurl reprepro
[34m==>[0m [1mUpdated Formulae[0m
[1minetutils [32m✔[0m[0m libfabric
[1mkubernetes-cli [32m✔[0m[0m libgda
[1mlxc [32m✔[0m[0m libgit2
[1mopenssl [32m✔[0m[0m libglademm
[1mpython [32m✔[0m[0m libgnomecanvasmm
[1msqlite [32m✔[0m[0m libgosu
abcde libgpg-error
abcmidi libgphoto2
ace libgtop
activemq-cpp libgweather
adwaita-icon-theme libheif
aescrypt-packetizer libhttpserver
afflib libidn2
afio liblas
agedu libmagic
akamai libosinfo
algernon libosmium
allure libphonenumber
amazon-ecs-cli libpointing
ammonite-repl libpq
amqp-cpp libpqxx
angular-cli libpsl
annie libpulsar
ansible libqalculate
ansible-lint libraw
apache-flink librealsense
apache-opennlp librsvg
apache-zeppelin libsass
ape libsecret
apibuilder-cli libsigc++
apktool libsoup
app-engine-java libssh
appledoc libssh2
apt-dater libswiften
arangodb libtensorflow
aravis libtermkey
aria2 libtiff
arm-linux-gnueabihf-binutils libtorrent-rasterbar
armadillo libu2f-host
arpack libuninameslist
artifactory libuv
asciidoctorj libvirt
asdf libvmaf
asio libvoikko
ask-cli libvpx
aspcud libvterm
atk libxlsxwriter
atkmm libxml++
atomist-cli libxml++3
ats2-postiats libxml2
aubio libxslt
auditbeat libyaml
aurora libzip
autoconf-archive lighttpd
autogen linkerd
avfs links
avian liquibase
aws-okta llvm
aws-sdk-cpp llvm@3.9
awscli llvm@4
axel llvm@5
azure-cli llvm@6
azure-storage-cpp lmod
babeld log4cplus
babl logrotate
backupninja logstalgia
bacula-fd logstash
ballerina logtalk
baobab lolcat
bartycrouch lsd
basex ltc-tools
bash lynis
bashdb lzlib
bat macvim
batik mafft
bazel magnetix
bedops mame
bee mandoc
befunge93 mapcrafter
bettercap mapnik
bgpstream mariadb
bibtexconv mariadb@10.0
bigloo mariadb@10.1
binaryen mariadb@10.2
bind mas
bindfs mat2
binutils math-comp
bison maxima
bit maxwell
bitcoin mdds
bitrise mednafen
blahtexml mercurial
blastem mesa
blueutil meson
bmake mesos
bnd metaproxy
boost metashell
boost-bcp metricbeat
boost-build micronaut
boost-mpi mill
boost-python minimal-racket
boost-python3 minio
botan minio-mc
bower miniserve
boxes mitie
brew-php-switcher mkcert
bro mkl-dnn
btfs mkvtoolnix
buildifier mlkit
bundletool mmark
burp moarvm
bwm-ng modd
bzt mogenerator
c-blosc monero
caddy monetdb
caf mongo-cxx-driver
caffe mongodb
cairomm mongodb@3.0
calabash mongodb@3.2
calcurse mongodb@3.4
calicoctl mongodb@3.6
capnp monit
cargo-completion mono
carrot2 mosh
carthage mosquitto
cash-cli mpd
cassandra mpfr
cassandra@2.1 mplayer
cassandra@2.2 mplayershell
cataclysm mpv
ccrypt mrboom
cdk mutt
cdogs-sdl mysql
certbot mysql-client
cfengine mysql-cluster
cflow mysql@5.6
cfr-decompiler mysql@5.7
cglm nativefier
chakra nats-streaming-server
chapel ncdu
check_postgres ncmpcpp
checkbashisms ncompress
checkstyle needle
chkrootkit neo4j
chrome-cli netcdf
chronograf netdata
clamav netpbm
cli53 newsboat
click nexus
clingo nghttp2
clipsafe nginx
clojure ngircd
closure-compiler nicovideo-dl
clutter-gst nifi
cmake nim
cmark-gfm ninja
cmus nkf
cockroach nnn
cocoapods node
cointop node-build
collada-dom node@10
collectd node@6
collector-sidecar node@8
commandbox nordugrid-arc
composer nqp
conan nspr
configen nss
confluent-oss ntopng
conjure-up ntp
conserver nu
console_bridge numpy
consul nuxeo
consul-template nwchem
container-diff nzbget
convox objc-codegenutils
coq ocrmypdf
coreutils octave
coturn odpi
couchdb offlineimap
cppcheck ohcount
cppcms ompl
cpprestsdk onscripter
cproto opa
cquery opam
crc32c open-mpi
cromwell openal-soft
crowdin opencc
cryfs openclonk
cryptominisat opencoarrays
cryptopp openconnect
crystal opencv
cscope opencv@3
csfml opendetex
csv-fix openfortivpn
ctop openimageio
cucumber-cpp openrct2
curl opensaml
curl-openssl openssl@1.1
curlpp opentracing-cpp
cython openvdb
czmq osm-pbf
dar osquery
darcs osrm-backend
dartsim overmind
dav1d oxipng
davix p11-kit
davmail packer
dbhash pacvim
dbxml pagmo
dcd paket
dcmtk pandoc
ddrescue pandoc-citeproc
deark pangomm
debianutils parallel
deja-gnu parallelstl
dep passenger
deployer pcl
devd pcre
dhall pdf2htmlex
dhall-json pdfgrep
dhex pdftoedn
dialog pdftoipe
diff-pdf pdnsrec
diff-so-fancy percona-server
diffoscope petsc
diffstat petsc-complex
digdag pgloader
direnv pgroonga
dita-ot pgrouting
django-completion pgweb
dlib phoronix-test-suite
dmd php
dmenu php-code-sniffer
dnscrypt-proxy php@7.1
dnsperf php@7.2
dnsviz phpmyadmin
docfx phpunit
docker picard-tools
docker-completion picat
doctl pioneer
doitlive pioneers
dosbox-x pipenv
double-conversion pius
dovecot pixman
dpkg planck
draco plank
dscanner plantuml
dspdfviewer platformio
dtc pmd
dub podofo
duck pony-stable
dwdiff ponyc
dwm poppler
dyld-headers postgres-xc
dynamips postgresql
dynare postgresql@9.4
easyengine postgresql@9.5
eccodes postgresql@9.6
efl povray
eiffelstudio powerman
elasticsearch ppsspp
elasticsearch@5.6 pre-commit
elektra precomp
elixir prefixsuffix
embulk presto
emscripten prettier
encfs primesieve
enet profanity
enigma prometheus
epubcheck protobuf
erlang protobuf-c
erlang@20 protobuf-swift
eslint prototool
etcd pspg
ethereum psql2csv
exiftool pulledpork
exomizer pulseaudio
exploitdb pulumi
faas-cli pushpin
fabio puzzles
fastbit pycodestyle
fastqc pygobject3
fcl pypy
fd pypy3
ffmpeg pyside
ffmpeg@2.8 python@2
fifechan qjackctl
file-formula qpdf
file-roller qt
firebase-cli quex
fish r
flac rabbitmq
flake8 rakudo
flann rawtoaces
flow rbspy
fluid-synth rclone
fn re2
folly rebar3
fontforge redis
fonttools redis@4.0
freeswitch repo
freetds rethinkdb
freetype rgbds
frugal rhash
fswatch riak
futhark rke
fwup rocksdb
fx rom-tools
gambit-scheme root
gammaray roswell
gauge rp
gcc rst-lint
gdal rtags
gdcm rtv
gdk-pixbuf ruby
geant4 ruby-build
geckodriver ruby@2.4
gecode ruby@2.5
gedit rust
genstats rustup-init
geocode-glib s3fs
gerbil-scheme safe
get_iplayer salt
gexiv2 sbcl
ghc scalariform
ghc@8.2 sccache
ghostscript sceptre
gibo scipy
git scrcpy
git-extras scw
git-flow-avh sdcv
git-fresh sdf
git-lfs securefs
git-quick-stats serveit
git-secrets serverless
gitbucket servus
gitlab-runner sf-pwgen
gjs sfcgal
glbinding sfml
glib shadowsocks-libev
glib-networking shared-mime-info
glibmm shellshare
globjects shellz
gloox shfmt
glslang shibboleth-sp
gmic ship
gmsh shmux
gmt shogun
gmt@4 siege
gnatsd simh
gnome-builder simple-mtpfs
gnome-latex simple-scan
gnome-recipes simutrans
gnu-tar singular
gnupg sip
gnupg-pkcs11-scd siril
gnuplot skaffold
gnuradio skinny
gnutls skopeo
go sl
go-statik slackcat
go@1.10 soci
go@1.9 solr
gobby sound-touch
gobject-introspection source-highlight
godep sourcery
golang-migrate spatialindex
gomplate spdlog
google-benchmark speedtest-cli
google-java-format sphinx
goreleaser sphinx-doc
gource spice-protocol
gr-osmosdr spotbugs
gradle sqlcipher
gradle-completion sqldiff
grafana sqlite-analyzer
graph-tool sqlmap
graphite2 squid
groonga sshuttle
groovy stk
grpc stone-soup
grv streamlink
gsettings-desktop-schemas subversion
gsmartcontrol sundials
gspell supersonic
gssdp supertux
gstreamermm svgo
gtk+3 swagger-codegen
gtkmm swagger-codegen@2
gtkmm3 swi-prolog
gtksourceview3 swift-protobuf
gtksourceview4 swiftformat
gtksourceviewmm swiftgen
gtksourceviewmm3 swiftlint
gucharmap switch-lan-play
guile switchaudio-osx
guile@2.0 syncthing
gwyddion synfig
gx task
gx-go taskell
hadolint tbb
handbrake tcl-tk
haproxy telegraf
harfbuzz teleport
hcloud template-glib
hdf5 terminal-notifier
hebcal terraform
helmfile terraform-inventory
hfstospell terraform_landscape
hg-fast-export terragrunt
highlight tesseract
hivemind texinfo
hledger tgui
homebank thors-serializer
howard-hinnant-date thrift
htmldoc tile38
htop timidity
httpd tintin
hub tippecanoe
hugo tmux-mem-cpu-load
hyperscan tmux-xpanes
i2pd tomcat
i386-elf-binutils tomcat-native
iamy tomcat@7
ibex tomcat@8
ice topgrade
igv tor
imagemagick tracebox
imagemagick@6 traefik
immortal trafficserver
influxdb treefrog
instead typescript
ios-sim ucloud
ios-webkit-debug-proxy uhd
ipfs umlet
ipv6calc unbound
ipython unrar
iso-codes unzip
ispc upscaledb
istioctl upx
jadx urbit
jasper urdfdom
jbake urdfdom_headers
jdupes v8
jenkins vagrant-completion
jenkins-lts vala
jenv valabind
jetty vault
jetty-runner vc4asm
jfrog-cli-go verilator
jhipster vert.x
jo vim
joplin vim@7.4
jruby vips
json11 visp
jsoncpp vowpal-wabbit
jsonnet vte3
jsonrpc-glib vtk
juju vultr
juju-wait w3m
kafka wabt
kakoune wartremover
kettle watchexec
kibana weaver
kibana@5.6 weboob
kitchen-sync weechat
knot wellington
kompose wesnoth
kops wget
kotlin whois
krakend widelands
ktmpl wildfly-as
kube-aws wine
kube-ps1 winetricks
kubectx wireguard-tools
kubeless wolfssl
kubernetes-helm wtf
kustomize x265
kyoto-cabinet xalan-c
lammps xcodegen
lcov xcproj
ldc xerces-c
lean-cli xml-security-c
ledger xml-tooling-c
leiningen xmrig
lgogdownloader xqilla
libassuan xsd
libbi xsimd
libbitcoin xtensor
libbitcoin-blockchain yaml-cpp
libbitcoin-client yamllint
libbitcoin-database yara
libbitcoin-explorer yarn
libbitcoin-network ydcv
libbitcoin-node yelp-tools
libbitcoin-protocol ykman
libbitcoin-server yle-dl
libcec you-get
libcerf youtube-dl
libchaos yq
libdazzle zbackup
libdill zmqpp
libdvdread znc
libetpan zorba
libextractor zsh
[34m==>[0m [1mRenamed Formulae[0m
ark -> velero resin-cli -> balena-cli
gloo-ctl -> glooctl todolist -> ultralist
[34m==>[0m [1mDeleted Formulae[0m
at-spi2-atk go@1.8 ruby@1.8 zxing-cpp
at-spi2-core liblastfm solr@5.5
gdnsd monax solr@6.6
go@1.4 percona-server@5.6 tmux-cssh

[34m==>[0m [1mTapping homebrew/cask[0m
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 4101, done.[K
remote: Counting objects: 100% (4101/4101), done.
remote: Compressing objects: 100% (4089/4089), done.
Receiving objects: 100% (4101/4101), 1.31 MiB | 1.00 MiB/s, done.
Resolg del: 100% (22/22), done.
Checking ouiles: 100% (4082/4082), done.
Tapped 1 command and 3994 casks (4,107 files, 4.2MB).
[34m==>[0m [1mSatisfying dependencies[0m
All Formula dependencies satisfied.
[34m==>[0m [1mDownloading https://github.com/PowerShell/PowerShell/releases/download/v6.1.[0m
[34m==>[0m [1mDownloading from https://github-production-release-asset-2e65be.s3.amazonaws[0m
######################################################################## 100.0%
[34m==>[0m [1mVerifying SHA-256 checksum for Cask 'powershell'.[0m
[32m==>[0m [1mInstalling Cask [32mpowershell[39m[0m
[34m==>[0m [1mCreating Caskroom at /usr/local/Caskroom[0m
[34m==>[0m [1mWe'll set permissions properly so we won't need sudo in the future.[0m
Password:
[34m==>[0m [1mRunning installer for powershell; your password may be necessary.[0m
[34m==>[0m [1mPackage installers may write to any location; options such as --appdir are i[0m
installer: Package name is PowerShell - 6.1.3
installer: Installing at base path /
installer: The install was successful.
🍺 powershell was successfully installed!

 

 

 

 インストールが完了したら、pwshとすればPower Shellが使用可能になります。

bash-3.2$ pwsh
PowerShell 6.1.3
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /Users/Yoshiki> ls

PS /Users/Yoshiki> pwd

Path
----
/Users/Yoshiki

PS /Users/Yoshiki> exit

 

 

 

 

 

www.slideshare.net

github.com

www.facebook.com

twitter.com

www.instagram.com

 

 

にほんブログ村 IT技術ブログ Linuxへ
Linux

にほんブログ村 IT技術ブログ オープンソースへ
オープンソース

 

 

Opensourcetech by Takahiro Kujirai