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

  • Home
  • SEARCH
  • 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 5996493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:06:40+00:00 2026-05-23T00:06:40+00:00

I have a power-shell script with which I am trying to back up a

  • 0

I have a power-shell script with which I am trying to back up a constantly changing number of SQL databases. Fortunately all of these databases are listed in a registry key. I am leveraging this in a for-each loop. The issue that I am having is that after grabbing the registry value that I want, when I try to pass it into my function to back up the databases there seems to be information in the variable that I can get rid of. If I output the contents of the variable to the screen by just calling the variable ($variable) is shows just fine. But if I write-host the variable to the screen the extra “content” that shows up when calling the function also shows up.

Here is the part of the script that generates the contents of the variable.

foreach ($childitem in get-childitem "HKLM:\SOFTWARE\Wow6432Node\Lanovation\Prism Deploy\Server Channels")
{$DBName = get-itemproperty Registry::$childitem | select "Channel Database Name"
write-host $DBname}

Here is what write-host displays :

@{Channel Database Name=Prism_Deploy_Sample_268CBD61_AC9E_4853_83DE_E161C72458DE}

but what I need is only this part :

Prism_Deploy_Sample_268CBD61_AC9E_4853_83DE_E161C72458DE

I have tried looking online at how to do this, and what I’ve found mentions things similar to $variable.split and then specifying my delimiters. But when I try this I get an error saying “Method invocation failed because [System.Management.Automation.PSCustomObject] doesn’t contain a method named ‘split’.”

I’m at a loss as to where to go from where I’m at currently.

  • 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-23T00:06:41+00:00Added an answer on May 23, 2026 at 12:06 am

    select-object will return an object that has the named properties that you “select”. To get just value of that property, just access it by name:

    write-host $DBname."Channel Database Name"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a Powershell newbie, trying to get a simple script to run. I have
I have a script saved in a ps1 file in which I define 2
I have a Powershell script that copies files from one location to another. Once
Does anyone have a Powershell script to change the credentials used by a Windows
I have a simple PowerShell script that uses WMI to create a web site
I have the following string expression in a PowerShell script: select count(*) cnt from
Ok so part two of I have no will power experiment is: Summary Question
I have a page that is accessed via a URL like this: http://power-coder.net/Test/something.php?id=3#Page1 I
Or do I have to pinvoke native code? I don't want the power status...well
I have spent sometime trying to pick one, on net comparisons are for zsh

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.