Skip to content

Instantly share code, notes, and snippets.

@yesoreyeram
Last active May 7, 2019 16:18
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 yesoreyeram/861a0cece37c71ff3130543d318d08d8 to your computer and use it in GitHub Desktop.
Save yesoreyeram/861a0cece37c71ff3130543d318d08d8 to your computer and use it in GitHub Desktop.
DSC Installtion
#!/bin/sh
# $1 - DSC ServerURL
# $2 - DSC RegistrationKey
# $3 - DSC ConfigurationName
mkdir -p /opt/downloads;
# https://github.com/microsoft/PowerShell-DSC-for-Linux/issues/432
mount -o remount,exec /tmp;
cd /opt/downloads;
if [ ! -f /opt/downloads/omi-1.1.0.ssl_100.x64.rpm ]; then
wget https://github.com/Microsoft/omi/releases/download/v1.1.0-0/omi-1.1.0.ssl_100.x64.rpm
fi
if [ ! -f /opt/downloads/dsc-1.1.1-294.ssl_100.x64.rpm ]; then
wget https://github.com/Microsoft/PowerShell-DSC-for-Linux/releases/download/v1.1.1-294/dsc-1.1.1-294.ssl_100.x64.rpm
fi
rpm -Uvh /opt/downloads/omi-1.1.0.ssl_100.x64.rpm /opt/downloads/dsc-1.1.1-294.ssl_100.x64.rpm
/opt/microsoft/dsc/Scripts/Register.py --ServerURL $1 --RegistrationKey $2 --ConfigurationName $3
exit 0;
#!/bin/sh
# $1 - DSC ServerURL
# $2 - DSC RegistrationKey
# $3 - DSC ConfigurationName
apt-get update -y;
mkdir -p /opt/downloads;
# https://github.com/microsoft/PowerShell-DSC-for-Linux/issues/432
mount -o remount,exec /tmp;
cd /opt/downloads;
if [ ! -f /opt/downloads/omi-1.1.0.ssl_100.x64.deb ]; then
wget https://github.com/Microsoft/omi/releases/download/v1.1.0-0/omi-1.1.0.ssl_100.x64.deb
fi
if [ ! -f /opt/downloads/dsc-1.1.1-294.ssl_100.x64.deb ]; then
wget https://github.com/Microsoft/PowerShell-DSC-for-Linux/releases/download/v1.1.1-294/dsc-1.1.1-294.ssl_100.x64.deb
fi
dpkg -i /opt/downloads/omi-1.1.0.ssl_100.x64.deb /opt/downloads/dsc-1.1.1-294.ssl_100.x64.deb
/opt/microsoft/dsc/Scripts/Register.py --ServerURL $1 --RegistrationKey $2 --ConfigurationName $3
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment