2024-11-13-ean
Powershell linuxen
Windows erabiltzen dute lanean, eta horregatik "powershell" script bat sortu behar izan dut.
Baina poztu nau jakiteak Windows-ek debian package-a sortu zuten powershell instalatzeko.
###################################
# Prerequisites
# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget
# Get the version of Debian
source /etc/os-release
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/debian/$VERSION_ID/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Delete the Microsoft repository GPG keys file
rm packages-microsoft-prod.deb
# Update the list of packages after we added packages.microsoft.com
sudo apt-get update
###################################
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
pwsh
Eta hemen duzue nire lehen powershell scripta:
CSV fixategi bat irakurtzen eta cli53 komandoa erabiltzen du domeinua kentzeko.
foreach ( $subdomain in Get-Content ./domains.csv)
{
$domain=($subdomain -replace '^.*?([^\.]+\.[^\.]+)\.$','$1');
cli53 rd $domain $subdomain CNAME
}