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 8045479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:33:36+00:00 2026-06-05T05:33:36+00:00

I like to write a cmdlet Convert-ToHashTable which performs following task: $HashTable = Import-Csv

  • 0

I like to write a cmdlet “Convert-ToHashTable” which performs following task:

$HashTable = Import-Csv Table.csv | Convert-ToHashTable

Import-csv places an array on the pipeline, how can i change it to a hashtable in my Convert-ToHashTable cmdlet? In the Process part of the cmdlet i can access the elements, but i don’t know how to change the type of the pipeline itself

Process
{
Write-Verbose “Process $($myinvocation.mycommand)”
$CurrentInput = $_
…
}

Is there a way to return a complete hashtable as the new pipeline or create a new pipeline with type hashtable?

  • 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-06-05T05:33:38+00:00Added an answer on June 5, 2026 at 5:33 am

    What do you plan to use as keys for hashtable? other than that, it should be pretty easy to do even with simple foreach-object:

    Import-Csv Table.csv | Foreach-Object -begin {
        $Out = @{}
    } -process {
        $Out.Add('Thing you want to use as key',$_)
    } -end {
        $Out
    }
    

    Don’t see need for any “change pipeline type” magic, honestly…?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I like to write synthetic query on db tables like the following: Decimal sum
I'd like to write a wrapper function for the mvwprint/mvwchgat ncurses functions which prints
I'd like write a function like the following // The type 'MethodGroup' below doesn't
I like to write a template system in Python, which allows to include files.
I like to write linux newlines, under windows, but QT automatically convert \n to
How do I dynamically add a PDO statement into array? I would like write
Why isn't Powershell's Write-Error cmdlet working for me? My output doesn't look like the
I like to write a process in Worker role, to download (sync) batch of
I would like to write the radian units of the axes as proportional to
I would like to write nested query with Doctrine; Sample SQL is like below:

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.