Converting console-based script to Powershell Universal


I’m looking at using Powershell Universal for my organisation in order to solve and automate many problems and activities that we normally do manually (account creation, service desk activities, that kind of thing).

The first win for this would probably be the automation of our HR-to-AD information. At present the HR data is provided as a CSV file, and we manually copy this to a server and run a powershell script that updates job titles etc.

Using the upload capability of PSU would solve the first part, but can anyone suggest how to provide feedback to the user while the import is running? I was envisioning a sort of text-based output that reflects what is in the log that is produced, but it would be nice to have a visual progress indicator.

I’ve looked at New-UdProgress, but I can’t figure out how to update it as the script executes.

Any help and suggestions much appreciated!


Hi Iain, welcome to the community.

Sync-UDElement can be used to refresh components in a dashboard, and set-udelement to change its content.

More reading on elements, with examples can be found here
Element - PowerShell Universal

The section regarding adding items to a list sounds like a good starting point.


Thanks very much for that. I’m working my way through some code examples and the documentation :slightly_smiling_face: