Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4568678
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:06:39+00:00 2026-05-21T19:06:39+00:00

Just for curiosity, it’s not a ‘I must have it’, but how declare a

  • 0

Just for curiosity, it’s not a ‘I must have it’, but how declare a tuple using system.tuple class in powershell?

I’m using powershell.exe.config to load framework 4.0 but I’m not able to create a tuple.

Trying this:

PS C:\ps1> $a = [System.Tuple``2]::Create( "pino", 34)

Chiamata al metodo non riuscita. [System.Tuple`2] non contiene un metodo denominato 'Create'.
In riga:1 car:31
+ $a = [System.Tuple``2]::Create <<<< ( "pino", 34)
    + CategoryInfo          : InvalidOperation: (Create:String) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

sorry for Italian sample…

Thank you for help.

EDIT:

if i try:

PS C:\ps1> $a = [System.Tuple]::Create(34,"pino")

Impossibile trovare un overload per "Create" e il numero di argomenti: "2".
In riga:1 car:28
+ $a = [System.Tuple]::Create <<<< (34,"pino")
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T19:06:40+00:00Added an answer on May 21, 2026 at 7:06 pm

    Here is a way

    PS> $a = New-Object 'Tuple[string,int]'("Jack", 78)
    PS> $a
    
    Item1                                             Item2
    -----                                             -----
    Jack                                              78
    

    Another one

    PS> $dpt = New-Object 'Tuple[string,string,int]'("Cantal", "Aurillac", 15)
    PS> $dpt.Item2
    Aurillac
    

    ——EDIT——

    Recall

    to see which CLR you are using, just use $PSVersionTable

    PS C:\> $PSVersionTable
    Name                           Value
    ----                           -----
    CLRVersion                     2.0.50727.4959
    BuildVersion                   6.1.7600.16385
    PSVersion                      2.0
    WSManStackVersion              2.0
    PSCompatibleVersions           {1.0, 2.0}
    SerializationVersion           1.1.0.1
    PSRemotingProtocolVersion      2.1
    

    if you want PowerShell to start using CLR 4.0 you have to put the file powershell.exe.config in the folder $PSHOME (C:\Windows\System32\WindowsPowerShell\v1.0)

    powershell.exe.config :

    <?xml version="1.0"?>
    <configuration>
      <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0.30319"/>
        <supportedRuntime version="v2.0.50727"/>
      </startup>
    </configuration>
    

    Result :

    PS C:\Users\JPB> $PSVersionTable
    Name                           Value
    ----                           -----
    PSVersion                      2.0
    PSCompatibleVersions           {1.0, 2.0}
    BuildVersion                   6.1.7600.16385
    PSRemotingProtocolVersion      2.1
    WSManStackVersion              2.0
    CLRVersion                     4.0.30319.225
    SerializationVersion           1.1.0.1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just out of curiosity, how does iostream access the input-output system. (I have a
Just a curiosity, (I'm not an expert), can I run my current operating system
What happens if I finish the drive letters? It's just curiosity, but I have
Just a curiosity, I have played around with prototyping a bit, but it seems
Just a general curiosity question. Why is this namespace System.Collections.Generic added by default in
Just a curiosity question. Remember when in class groupwork the professor would divide people
Just out of curiosity I tried overriding a abstract method in base class, and
This is just curiosity on my part, but what is more efficient, recursion or
I'll start by saying that this isn't a problem, just curiosity. I have some
It not just my curiosity, recently I've received a bugreport concerning one of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.