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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:37:38+00:00 2026-06-07T02:37:38+00:00

I have a PowerShell function where I’m getting a strange parsing error (it won’t

  • 0

I have a PowerShell function where I’m getting a strange parsing error (it won’t compile, both PowerGUI (the editor I use), and PowerShell (when I try to Import-Module)), give me a Parsing error.

Here’s a link to pastebin with my code: My Function @ Pastebin

Here’s a link to a picture showing the parsing-error-message: Error message @ Imgur

Anyone familiar with this parsing error? I tried deleting the Write-Verbosestatements it complained about, but that didn’t help any, it just jumped to the next one, even if it was inside a completely different codeblock. (E.G. Process{...} vs End{...}).

  • 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-07T02:37:41+00:00Added an answer on June 7, 2026 at 2:37 am

    You’re missing a backtick before on the quote before ‘Any Errors’ on line 161:

    Write-Error "`"Could not connect to remote computer $server!`"`n`t`t`t`t`t`t`t`t      "Any errors on line 109 relates to this fact.`""
    

    Should be:

    Write-Error "`"Could not connect to remote computer $server!`"`n`t`t`t`t`t`t`t`t      `"Any errors on line 109 relates to this fact.`""
    

    That caused some mismatched quotes which then caused the last quote in your script, i.e. the one at the end of “Returning Hashtable…” on line 247, to throw an error.

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

Sidebar

Related Questions

I have some code in a powershell function that looks like this: try {
I have a really simple PowerShell function that I use to make notes to
I have a powershell function that takes a parameter like this: function whatever {
I have the following PowerShell code: function Get-SmoConnection { param ([string] $serverName = ,
I am using the below PowerShell function to parse event logs that have been
I have a function in powershell 2.0 named getip which gets the IP address(es)
Background: Suppose I have a powershell function that understands and interprets small_commands such as:
I am just getting started with Windows Powershell and I am try to create
I have function in a powershell 2.0 script that I am launching as a
I often have the following situation in my PowerShell code: I have a function

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.