Skip to content

Instantly share code, notes, and snippets.

View onecentlin's full-sized avatar

Winnie Lin onecentlin

View GitHub Profile
@onecentlin
onecentlin / CheckDotnetHostingBundleVersion.ps1
Created April 12, 2021 17:02 — forked from poychang/CheckDotnetHostingBundleVersion.ps1
[檢查 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"
}