Skip to content

Instantly share code, notes, and snippets.

@poychang
Created November 23, 2018 01:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save poychang/239f6a11fd9e9d1606b499839d991b62 to your computer and use it in GitHub Desktop.
Save poychang/239f6a11fd9e9d1606b499839d991b62 to your computer and use it in GitHub Desktop.
[檢查 IIS 的 .NET Core Hosting Bundle 版本] #powershell
$DotNETCoreUpdatesPath = "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Updates\.NET Core"
$DotNetCoreItems = Get-Item -ErrorAction Stop -Path $DotNETCoreUpdatesPath
$NotInstalled = $True
$DotNetCoreItems.GetSubKeyNames() | Where { $_ -Match "Microsoft .NET Core.*Windows Server Hosting" } | ForEach-Object {
$NotInstalled = $False
Write-Host "The host has installed $_"
}
If ($NotInstalled) {
Write-Host "Can not find ASP.NET Core installed on the host"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment