Can PowerShell arrays hold diferrent data types ?

Welcome Forums General PowerShell Q&A Can PowerShell arrays hold diferrent data types ?

This topic contains 2 replies, has 2 voices, and was last updated by

bin
 
Participant
6 days, 22 hours ago.

  • Author
    Posts
  • #170311
    bin

    Participant
    Topics: 5
    Replies: 4
    Points: 29
    Rank: Member

    hello

    i know that you cannnot mix data type in the same array like this

    @("hello",1..10)

    but is it a way to do it?

    thank you

  • #170320

    Participant
    Topics: 9
    Replies: 409
    Points: 603
    Helping Hand
    Rank: Major Contributor

    of course you can

    @("hello",(1..10))
    

    Practical guide to PowerShell Arrays

  • #170428
    bin

    Participant
    Topics: 5
    Replies: 4
    Points: 29
    Rank: Member

    thank you

The topic ‘Can PowerShell arrays hold diferrent data types ?’ is closed to new replies.