diff --git a/Types/PSJekyll.Site/set_Domain.ps1 b/Types/PSJekyll.Site/set_Domain.ps1 new file mode 100644 index 0000000..37e3998 --- /dev/null +++ b/Types/PSJekyll.Site/set_Domain.ps1 @@ -0,0 +1,17 @@ +<# +.SYNOPSIS + Sets the domain name of the site. +.DESCRIPTION + Sets the domain name of the Jekyll site. + + This will create a CNAME file in the root of the site. +#> +param([string]$cname) +$cNamePath = Join-Path $this.Directory "CNAME" +New-Item -ItemType File -Path $cNamePath -Force -Value $cname +$tryToResolveCName = try { + [Net.Dns]::Resolve($cname) +} catch { + Write-Warning "Could not resolve the domain name '$cname'." +} +