powershell.sh 802 Bytes
Newer Older
1 2 3 4 5 6
#!/bin/sh

PKGNAME=powershell
SUPPORTEDARCHES="x86_64"
VERSION="$2"
DESCRIPTION="Microsoft PowerShell from the official site"
7
URL="https://github.com/PowerShell/PowerShell"
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

. $(dirname $0)/common.sh

[ "$VERSION" = "*" ] && VERSION="[0-9]*" || VERSION="$VERSION-1"

reponame=$(epm print info --repo-name)
vendor=$(epm print info -s)
version=$(epm print info --base-version)

# Strict supported list
case $(epm print info -e) in
    Ubuntu/*)
        BASEURL="https://packages.microsoft.com/ubuntu/$version/prod/pool/main/p/powershell/"
        file="powershell_$VERSION.deb_amd64.deb"
        ;;
    *)
24
        BASEURL="https://github.com/PowerShell/PowerShell/releases"
25 26 27 28
        file="powershell-$VERSION.rh.x86_64.rpm"
        ;;
esac

29
PKGURL=$(eget --list --latest $BASEURL "$file")
30

31
install_pkgurl