MikeCarlo / BusinessOps

Business Ops is designed to be the single collection of community driven External Tools. This Local Desktop Installer will enable the addition of over 30+ External tools
27 stars 0 forks source link

Launch PS Scripts using VB Script #3

Open samaguire opened 4 years ago

samaguire commented 4 years ago

You should consider launching the PS scripts using VB Script. There are several advantages to this:

See the attached example of this which I wrote. NB, the "runas" can be removed if window elevation isn't required.

practicedataset.pbitool.json.zip

MikeCarlo commented 3 years ago

@JamesDBarlett3 Wondering your thoughts on this. Seems like a solid idea.

samaguire commented 3 years ago

You might want to have a look at my latest version: https://github.com/samaguire/PBIdesktop-PracticeDataset/releases/tag/v3.0.1

It is entirely PS driven, launching in bypass mode to get around security requirements and pulls the required files from GitHub if needed or a newer version is available.

JamesDBartlett3 commented 2 years ago

@MikeCarlo This is indeed an interesting idea. If you open up the practicedataset.pbitool.json from @samaguire's previous comment, you'll see that the PowerShell command executes a ScriptBlock encoded in Base64. Here's what that ScriptBlock looks like in string format:

image It's actually fetching the latest version of everything it needs from the GitHub repo in real-time, stashing it on the hard drive, and then opening it from there.

I see only one potential downside to this technique in its current implementation: The PowerShell script is hard-coded in the actual pbitool.json file itself, which is not one of the files auto-updated by the script, so any updates to the pbitool.json file (or the PowerShell script embedded therein) would still need to be performed manually. All of that being said, this kind of thing would definitely be a step in the right direction, particularly as we begin exploring ways to decouple the various external tool installers from the Business Ops installer.

samaguire commented 2 years ago

I agree with you @JamesDBartlett3. Embedding the logic in the pbitool.json isn't the most dynamic way to handle this.

I had thought about using this technique to pull down just a PS script that was the actual launcher to pull down other additional files, this way the pbitool.json could remain static. However, at the time I thought it was a bit overkill - I was in control of the GIT repo and any updates would be to the files that are being retrieved.