Are all the things i outline here, possible with Powershell Universal?

Product: PowerShell Universal
Version: 1.4.6

Hello,

I have been using AWX to create new machines in VMWare. We’re about to upgrade our environment and have to update our existing AWX job(s). Although the job(s) work, it isn’t ideal.
One of the key features that we are lacking, is the option for Dynamic (suvery) Forms. Something i know is possible with Universal. Furthermore, AWX can work with PowerShell but it wasn’t built around it.

I use PowerShell on a regular basis and I always knew of ‘PowerShell Dashboard’.
Now, finally in 2024 I have the chance to really look into it.

I’ve been watching some YouTube videos and have been Googling my way around certain topics.
Some questions got answered, some i’m still not clear on. So i’m hoping to find those answers here.

Deploy New-VM – What do we need\want

  • Be able to work with multiple credentials:

    • 1 credential to address VM-store
    • 1 credential to address DNS-tool
    • 1 credential to address KeePass
    • 1 credential that has access to Active Directory
  • Dynamic forms (UI)

    • Make a dropdown dependent on the input from a previous chosen UI-element. :white_check_mark:
  • Can one App-Dashboard execute multiple scripts?

    • Can they be performed in steps? Ideally, these steps are ‘linked’ or ‘in sequence’.
    • Is there a log possible per step? Very similar to how Jenkins works for example.

    Example

  • Step 1 → create VM

  • Step 2 → configure VM

  • Step 3 → Add to VM pool

  • step 4 → Add credentials to KeePass

  • step 5 → …

The credentials above, would be used per script.
The cred for VM would be used instep 1, the cred for KeePass in step 4, … . (similar to AWX)
For now, these are my main questions.
I hope someone here can answer them (or some).

Thank you in advance!

KST - Snak3d0c on Slack\Discord

The short answer is yes. PowerShell Universal can do all of those things. Getting it to do them is a lot more involved than AWX. AWX provides the UI for you. In PSU, you have to build it yourself.

Credentials

In PowerShell Universal, your variables can be secret. For credentials, I usually have a regular variable for the username and secret variable for the password. You can then use those variables to construct a PSCredential object.

All-in-one dashboard with logging

You can pretty much do anything, but, again, you have to build it yourself. I haven’t had a need for using the Scripts/Jobs features of PSU, so I’ll let someone else give you details/caveats regarding using them with Dashboards and how satisfied you may be with the job log. I put most of the code in the pages themselves. If you’re doing that, you’ll be rolling your own logging.

I’ve been thinking of doing a similar project because I’m also disappointed with AWX surveys. I haven’t gone beyond the “thinking” stage, but I was considering using PSU as a front-end to execute jobs in AWX. If you do that, the only credential you have to worry about is your AWX API key. You can continue managing all of the other credentials in AWX.

Thanks Rob,

I’ll have a look into how the credentials work, haven’t gotten that far.
The documentation isn’t super clear on when to use pages vs ‘Apps’. As far as i can see an App is an accumulation of pages.

In the available examples (e.g. Hyper-V), the UI code and the logical code is all in one place. I love the simplicity of that however, with the amount of code my AWX job has, i recon it would become very messy very quickly.
So if it doesn’t complicate things too much, I’d prefer keeping UI and Logic separate.

I like your idea of using the API but I’d prefer to ditch AWX all together.
My knowledge of YAML is basic. Debugging it is a nightmare and time consuming.

I might end up having to use AWX still, but after my exploration of PU I’m def looking into this more. This creates some nice enhancement opportunities!

1 Like

As far as i can see an App is an accumulation of pages.

Correct. An app is the webpage itself.

So if it doesn’t complicate things too much, I’d prefer keeping UI and Logic separate.

You can save the logic/scripting part of your code as a script and call it with Invoke-PSUScript, passing any parameters you need. I do this with a device test page where I give a table with available tests, the technician selects the tests they want to run, click a button and it invokes the script with the selections as the parameters.

1 Like