James Brundage | MVP
mrpowershell.com
James Brundage | MVP
@mrpowershell.com
1.5K followers 440 following 2.5K posts
Jack of all Trades, Master of PowerShell. Prolific Programmer Microsoft MVP in Azure / PowerShell https://mrpowershell.com/ https://github.com/StartAutomating https://github.com/PowerShellWeb NB, Neurodivergent, Nerdy, Newsjunkie. Ask me anything.
Posts Media Videos Starter Packs
Thanks for realizing it works both ways.

Less cool to dunk on a language I clearly prefer (I try not to dunk)

Also, just wondering? Why use backticks?

I barely ever see them these days.

Ask for help and you might find it...

PowerShell has lots of magic other languages do not.
Works the other way around, too 😉

#PowerShell can call any #Bash script, #Python Script, #Node, #Go, #Rust application.

If they pipe (|) the output, they can even parse line-by line:

./My.py | ? { $_ -match 'keyword' }

Shell languages are useful, and the Object Pipeline is Overpowered.
You're not too far from the really cool use case, which is letting a switch match multiple regexes in order.

Very handy for making small parsers.

Bonus points: switch conditions can be variables.
It's good practice if you don't want multiple items to match.

Left to their own devices, PowerShell switches match all of the conditions they can, in the order they were declared.

This is more useful / cool / important with switch -regex

Hope this helps!
Happy to understand this for either. How will it be laid out in PBIP?

I would like to be able to seamlessly import and export data from PowerShell into / out of PowerBI.
Honestly I'd like to know the format encoding enough to make my own PowerBi packages from scratch ( as I can for almost all other OPC archives ).

Would love to make a script that queries some data with PowerShell and updates a pbit/pbix.

Where can I find the docs?
I take it you mean that this file supports signatures / encryption on a base level, and will not read via API without a key. Correct?

(this matches what I've seen, re protected word documents).

Seems like there's good plumbing for this scenario.
Yeah, this was the inspiration. I've known about it for years but last week I went and made a base module for OpenXML

github.com/PowerShellWe...

That got my brain churning a bit more on the subject.

Putting unwelcome content in another package is bad, but making a new one....
GitHub - PowerShellWeb/OpenXML: Automate OpenXML with PowerShell
Automate OpenXML with PowerShell. Contribute to PowerShellWeb/OpenXML development by creating an account on GitHub.
github.com
Yeah, I'm thinking one of the benefits of a consistent packaging abstraction is the ability to scan content.

I suppose you would know better than most :-)

I figure a good tool will leave a trace, and a package without those traces is a risk. The more tracing, the less risk.
Happy for help on this front.

I'm thinking I'd like to provide ample provenance information from git where available, along with some static analysis that can be safely double-checked.

(i.e. if it says it doesn't invoke-expression, and it really doesn't invoke-expression)
Kicking things off:

I want to be able to treat any directory as a package.

I want to be able to inspect commands without running them.

I want to know where a package came from.

I want to be able to browse a package.

What else...?
Eh, I wouldn't complain.

I love my #vscode these days, and appreciate all the #PowerShell ISE could do, but/also/and...

Wrote everything during the Vista / Win7 ship cycles in notepad.

So, ~4 years of pure notepad (editors under construction)

Truly helps you learn languages. And is a pain.
Yeah, it wasn't the team's call, and there are _lots_ of mitigations to this. Exchange's attachment blocking is the cloud mitigation.

Opening to read instead of run is the local mitigation

The ISE is/was a whole other ball of wax.

Short version is: totally different surface area.
Last week I remember just how many different files are "zip files in a trenchcoat"

This week I'm wondering:

What would you want in a PowerShell / Shell archive format?

en.wikipedia.org/wiki/Open_Pa...
Open Packaging Conventions - Wikipedia
en.wikipedia.org
Because for a hot minute there were VBScript viruses that spread thru email and nobody on the PowerShell team / org wanted that to be easy with PowerShell.

So many layers of countermeasures were devised.

Chief among them: double clicking a PowerShell script should not run it.
Just a bit of #Fibonacci #Friday #Fun #Math #PowerShell

Here's a _really_ fast Fibonacci Sequence generator.

It gets me the first 1024 numbers in around ([TimeSpan]'00:00:00.0002212') seconds.

On a #RaspberryPi 😉😎

gist.github.com/StartAutomat...

Enjoy!
Gist a fast Fibonacci
Gist a fast Fibonacci. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I believe everyone needs to share their knowledge:

You can't take it with you, and hoarding your knowledge hurts the human race.
💯

I helped build a language ( #PowerShell ), and I am still _constantly_ having to double-check a thing.

Just because I know a language like the back of my hand doesn't mean I know _everything_ about it.

Even if you make languages, you'll be constantly surprised by them.
For nerdy reference / understanding...

STL is basically a series of triangles. There are two "unfortunate" parts of this.

1. It repeats intersecting coordinates
2. It does not make the vertices clear

So 3MF uses less space, and is more clear to read.
#TodayILearned #TIL that .3mf files are just a .zip file in a trenchcoat.

This one I like 😉

A .3mf file is "mostly" just a compressed #XML file representing the model.

It mainly contains the vertices and triangles between them.

Very simple and easier to understand than STL. 😀

#3DPrinting
Exactly what I mean.

en.wikipedia.org/wiki/Open_Pa...

(wrote an OpenXML module the other day, and seeing what else in this area might be useful)
Open Packaging Conventions - Wikipedia
en.wikipedia.org
Yep, and I'm just trying to encourage and hopefully steer anyone away from the rocks.

Some things in tech are easy.

Lots of things in tech are an endless rabbit hole to wonderland, and it helps to have a friend holding a rope to the real world.