This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmacos.sh
executable file
·68 lines (58 loc) · 2.46 KB
/
macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -e
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
####################################################################################################
# This script installs the following tools in your Mac OS machine: #
# - Azure CLI #
# - Bicep #
# - Homebrew #
# - Packer #
# - Partner Center CLI #
# - Pester #
# - PowerShell #
####################################################################################################
# Provide a path for the Python virtual environment
venvPath="${1:-myEnv}"
# Install Homebrew
which brew
if [[ $? != 0 ]] ; then
echo "Installing Homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Updating Homebrew..."
brew update
fi
# Install Azure CLI
echo "Installing Azure CLI..."
brew install azure-cli
# Install Bicep
echo "Installing Bicep..."
az bicep install
# Install Packer
echo "Installing Packer..."
brew tap hashicorp/tap
brew install hashicorp/tap/packer
# Install PowerShell
echo "Installing PowerShell..."
brew install powershell/tap/powershell
# Install Pester
echo "Installing Pester..."
pwsh -Command "Install-Module -Name Pester -Force -SkipPublisherCheck"
pwsh -Command "Import-Module Pester -Passthru"
# Install Partner Center CLI
if [[ "$(python3 -V)" =~ "Python 3" ]]; then
echo "Installing Partner Center CLI..."
echo "Creating new virtual environment at $venvPath..."
python3 -m venv $venvPath
echo "Activating virtual environment at $venvPath..."
source $venvPath/bin/activate
if [[ $VIRTUAL_ENV =~ $venvPath ]]; then
echo "Installing Partner Center CLI in $venvPath..."
pip install --upgrade pip
pip install az-partner-center-cli
deactivate
fi
else
echo "Please install Python 3.7 or higher to install the Partner Center CLI."
fi