Skip to content

Commit 9ae097a

Browse files
committed
tip: Update wording a bit
1 parent 413851f commit 9ae097a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PowerShellTips/2025-04-10-find-the-net-version-powershell-is-using.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $tip.Title = 'Find the .NET version PowerShell is using'
44
$tip.TipText = @'
55
$PSVersionTable will tell you which version of PowerShell is running, but it won't tell you which version of .NET is being used. This is important as sometimes you want to call .NET methods from PowerShell, or use .NET types, but they may have changed from one .NET version to the next.
66
7-
Minor Pwsh versions currently map to major .NET versions. For example, Pwsh 7.0 maps to .NET Core 3.1, 7.1 maps to .NET 5, 7.2 to .NET 6, 7.3 to .NET 7, 7.4 to .NET 8, and 7.5 to .NET 9. This isn't necessarily easy to remember though, and it may change in the future.
7+
Minor Pwsh versions currently map to major .NET versions. For example, Pwsh 7.0 uses .NET Core 3.1, 7.1 uses .NET 5, 7.2 uses .NET 6, 7.3 uses .NET 7, 7.4 uses .NET 8, and 7.5 uses .NET 9. This isn't necessarily easy to remember though, and the convention may change in the future.
88
99
Rather than relying on remembering a convention, we can use the following command to display the version of .NET being used:
1010
[System.Runtime.InteropServices.RuntimeInformation]::FrameworkDescription

src/tiPS/PowerShellTips.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@
924924
{
925925
"CreatedDate": "2025-04-10T00:00:00",
926926
"Title": "Find the .NET version PowerShell is using",
927-
"TipText": "$PSVersionTable will tell you which version of PowerShell is running, but it won't tell you which version of .NET is being used. This is important as sometimes you want to call .NET methods from PowerShell, or use .NET types, but they may have changed from one .NET version to the next.\r\n\r\nMinor Pwsh versions currently map to major .NET versions. For example, Pwsh 7.0 maps to .NET Core 3.1, 7.1 maps to .NET 5, 7.2 to .NET 6, 7.3 to .NET 7, 7.4 to .NET 8, and 7.5 to .NET 9. This isn't necessarily easy to remember though, and it may change in the future.\r\n\r\nRather than relying on remembering a convention, we can use the following command to display the version of .NET being used:\r\n[System.Runtime.InteropServices.RuntimeInformation]::FrameworkDescription\r\n\r\nNote: This property exists for all .NET Core versions, but was not introduced in .NET Framework until .NET Framework 4.7.1, so it may not work in Windows PowerShell versions using a lower version of .NET Framework.",
927+
"TipText": "$PSVersionTable will tell you which version of PowerShell is running, but it won't tell you which version of .NET is being used. This is important as sometimes you want to call .NET methods from PowerShell, or use .NET types, but they may have changed from one .NET version to the next.\r\n\r\nMinor Pwsh versions currently map to major .NET versions. For example, Pwsh 7.0 uses .NET Core 3.1, 7.1 uses .NET 5, 7.2 uses .NET 6, 7.3 uses .NET 7, 7.4 uses .NET 8, and 7.5 uses .NET 9. This isn't necessarily easy to remember though, and the convention may change in the future.\r\n\r\nRather than relying on remembering a convention, we can use the following command to display the version of .NET being used:\r\n[System.Runtime.InteropServices.RuntimeInformation]::FrameworkDescription\r\n\r\nNote: This property exists for all .NET Core versions, but was not introduced in .NET Framework until .NET Framework 4.7.1, so it may not work in Windows PowerShell versions using a lower version of .NET Framework.",
928928
"Example": "# Display the .NET version the current PowerShell session is using.\r\n[System.Runtime.InteropServices.RuntimeInformation]::FrameworkDescription",
929929
"Urls": [
930930
"https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.runtimeinformation.frameworkdescription"

0 commit comments

Comments
 (0)