36 lines
1013 B
Ruby
36 lines
1013 B
Ruby
cask "powershell" do
|
|
arch arm: "arm64", intel: "x64"
|
|
|
|
version "7.3.6"
|
|
sha256 arm: "36f796fde211623a966ed470d1a067ef22731aa1515980b61c0f068a4915d1fd",
|
|
intel: "5d023857bbf987698c053e5e64d9cc78db3e5ef35d62564767756527de52d878"
|
|
|
|
url "https://github.com/PowerShell/PowerShell/releases/download/v#{version}/powershell-#{version}-osx-#{arch}.pkg"
|
|
name "PowerShell"
|
|
desc "Command-line shell and scripting language"
|
|
homepage "https://github.com/PowerShell/PowerShell"
|
|
|
|
livecheck do
|
|
url :url
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
end
|
|
|
|
depends_on formula: "openssl"
|
|
depends_on macos: ">= :mojave"
|
|
|
|
pkg "powershell-#{version}-osx-#{arch}.pkg"
|
|
|
|
uninstall pkgutil: "com.microsoft.powershell"
|
|
|
|
zap trash: [
|
|
"~/.cache/powershell",
|
|
"~/.config/powershell",
|
|
"~/.local/share/powershell",
|
|
]
|
|
|
|
caveats <<~EOS
|
|
To use Homebrew in PowerShell, set:
|
|
Add-Content -Path $PROFILE.CurrentUserAllHosts -Value '$(#{HOMEBREW_PREFIX}/bin/brew shellenv) | Invoke-Expression'
|
|
EOS
|
|
end
|