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,596 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,287 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Rich Matheisen 45,671 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