• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
ControlUp Community

ControlUp Community

Connect, Learn, and Grow

  • Blog
  • Podcast
  • Meetups
  • Archives
  • Categories
    • ControlUp One Platform
    • ControlUp for Apps
    • ControlUp for Compliance
    • ControlUp for Desktops
    • ControlUp Scripts & Triggers
    • ControlUp Synthetic Monitoring
    • ControlUp for VDI
  • Topics
  • Events
    • Logos & Wallpaper
    • ControlUp.com
  • Join

Troubleshooting Data Storage Issues with PowerShell Script in ControlUp

Posted on February 12, 2024

A user had trouble with a powershell script not storing data in the data index on a specific device, but with the help of another user’s input, the issue was resolved. The correct script with a dummy key value, JSON format and dummy key field name can be found in the discussion.


Read the entire ‘Troubleshooting Data Storage Issues with PowerShell Script in ControlUp’ thread below:

I have created this powershell script to verify if the "EdgeUpdate" key is present in the device and store the results in the data index. It is not storing it when I run the script in a device. The script does not return an error after it is ran. I know that the script works because it has been working on the test device I have been testing it with.

$regkey = "HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate"

Lets me check if the registry key exists.

If (!(Test-Path -Path $regkey))

{

$regkeyexists = "The EdgeUpdate key does not exist!"

}

Else

{

$regkeyexists = "The EdgeUpdate key exists!"

}

$regkeyexists

Write-Output("### SIP DATA BEGINS ###")

Write your data to stdout here in JSON format

$regkeyexists | ConvertTo-Json

Write-Output("### SIP DATA ENDS ###")


I think it could be the ( ) in the last part?

Try like this:

Write-Output "### SIP DATA BEGINS ###"

$regkeyexists | ConvertTo-Json

Write-Output "### SIP DATA ENDS ###"

And I assume the script settings for the are all correct (e.g. timing, index name)


This is what I have set for the script.

I removed the ( ) but it still did not work.


And you ran the custom action on the specific device? Is the index there but just no data?


I did ran it from a specific device and the index is not there


@member you have any ideas?


Let me take a look at it.

JSON needs a key field name (not sure about the terminology.

Here is the code that I got to work

$regkey = "HKLM:\SOFTWARE\Policies\Microsoft\EdgeUpdate"

Lets me check if the registry key exists.

If (!(Test-Path -Path $regkey))

{

$regkeyexists = "The EdgeUpdate key does not exist!"

}

Else

{

$regkeyexists = "The EdgeUpdate key exists!"

}

$regkeyexists

$obj = @{

RegkeyInfo = $regkeyexists

Secondvalue = "0"

}

Write-Output("### SIP DATA BEGINS ###")

Write your data to stdout here in JSON format

$obj | ConvertTo-Json

Write-Output("### SIP DATA ENDS ###")

Write-Output("### SIP EVENT BEGINS ###")

Write your data to stdout here in JSON format

$obj | ConvertTo-Json

Write-Output("### SIP EVENT ENDS ###")

I added a dummy second key to the $obj array as I was getting an error with only one value in the array.

I output the data so you can see it in device evensts (SIP EVENT blah) as I find it easier to debug things this way.

I am sure there are more graceful ways to do this. Let me know if it works for you or not.

@member ping


@member Thanks!! This did work for me. I was able to add more values to the $obj array and they were added to the data index.


Glad I was able to help out.

Continue reading and comment on the thread ‘Troubleshooting Data Storage Issues with PowerShell Script in ControlUp’.  Not a member? Join Here!


Categories: All Archives, ControlUp for Desktops, ControlUp Scripts & Triggers
Topics: Microsoft, PowerShell, Scripts, Storage

Ask Us Anything, Connect, Learn, and Grow with the ControlUp Community!

Login to the ControlUp Community to ask us anything, stay up-to-date on what’s new and coming soon and meet other like-minded techies like you.

Not already a member? Join Today!

Primary Sidebar

ControlUp Academy

Enroll in ControlUp Academy for expert-led technical training, equipping you with skills to effectively deploy, manage, and grow your ControlUp investment.

Learn here >

Rotating Images

Hidden Gem from our Community on Slack!

ControlUp Betas - What's Coming Next?
NEW ControlUp Features - Stay Up-to-Date!
ControlUp Scripts - Scripting, Zero to Hero
Latest KB Articles - Be the First to Learn
Did you Know - with Sivan Kroitoru
Practical Perspectives Technical Use Case Training

Video Tutorials Library

Visit our technical how-to videos, offering step-by-step tutorials on advanced features, troubleshooting, and best practices.

Watch here >

ControlUp Blog

Check out the ControlUp blog for expert advice and in-depth analysis.

Read here >

ControlUp Script Library

Visit the ControlUp technical script library, which offers a multitude of pre-built scripts and custom actions for your monitoring and troubleshooting requirements.

See here >

ControlUp Support

Visit the ControlUp support home and to delve deeper into ControlUp solutions.

Browse here >

Download ControlUp RealTime DX

Start with ControlUp for real-time end-user environment insights, swift troubleshooting, and unprecedented performance optimization. Download now.

Download here >

Footer

      

ControlUp Community
Of Techie, By Techie, For Techie!

Terms of Use | Privacy Policy | Security
Dive Deeper, Learn more at ControlUp.com

  • facebook
  • twitter
  • youtube
  • linkedin

© 2023–2025 ControlUp Technologies LTD, All Rights Reserved.

We use cookies to ensure that we give you the best experience on our website. by continuing to use this site you agree to our Cookie policy..