Powershell: how does calling a .NET method work?

Hinterleitner Andreas 0 Reputation points
2024-07-01T08:24:30.82+00:00

When I make a call to .NET in, let's say, PowerShell 7.4.3, such as:

$HT = [System.Collections.Hashtable]::new()

am I right when I say that PowerShell uses the .NET version on which it is based, in my example 8.0.6?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,565 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,264 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Rich Matheisen 45,591 Reputation points
    2024-07-01T15:08:18.4566667+00:00

    Yes. But you lose the behaviors added by PowerShell.

    0 comments No comments

  2. Hinterleitner Andreas 0 Reputation points
    2024-07-02T04:14:12.0366667+00:00

    Thank you for your answers.

    0 comments No comments