facebook twitter hatena line email

「Windows/powershell」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(テキスト文置換)
 
(同じ利用者による、間の20版が非表示)
行1: 行1:
==powershellインストール==
+
[[Windows/powershell/インストール]]
https://docs.microsoft.com/ja-jp/powershell/scripting/install/installing-powershell-core-on-macos?view=powershell-7.1
+
  
macであれば、powershell-x.x.x-osx-x64.pkg をDL
+
[[Windows/powershell/コーディング規約]]
  
==macでpowershell実行==
+
[[Windows/powershell/基本]]
$ /usr/local/bin/pwsh /tmp/hoge.ps1
+
  
/tmp/hoge.ps1
+
[[Windows/powershell/文字列]]
echo 'hoge'
+
  
==変数化==
+
[[Windows/powershell/ファイル文字]]
$path = "hoge.txt";
+
$data = Get-Content $path
+
  
==テキスト文置換==
+
[[Windows/powershell/関数]]
aaaをcccへ置換
+
$data = Get-Content hoge.txt | % { $_ -replace "aaa", "ccc" }
+
$data | Out-File hoge.txt
+
  
参考:https://teratail.com/questions/290149
+
[[Windows/powershell/クラス]]
 +
 
 +
[[Windows/powershell/ini読込]]
 +
 
 +
[[Windows/powershell/eval]]
 +
 
 +
[[Windows/powershell/posh-git]]

2021年8月30日 (月) 20:49時点における最新版

Windows/powershell/インストール

Windows/powershell/コーディング規約

Windows/powershell/基本

Windows/powershell/文字列

Windows/powershell/ファイル文字

Windows/powershell/関数

Windows/powershell/クラス

Windows/powershell/ini読込

Windows/powershell/eval

Windows/powershell/posh-git