adfsToolbox icon indicating copy to clipboard operation
adfsToolbox copied to clipboard

Powershell 2.0 compatibility

Open madhavpatel6 opened this issue 7 years ago • 3 comments

Issue by rattuscz Monday May 28, 2018 at 16:51 GMT Originally opened as https://github.com/Microsoft/adfsLogTools/pull/20


Initial try to bring script to PS 2.0 compatible version - as our ADFS 2.0 are also PS2.0 :cry:

Analytics part still does not work - ConvertFrom-Json not in ps2

Not sure if this PS2.0 compatibility is even desirable in main branch, maybe as a separate? Anyway looking for feedback


rattuscz included the following code: https://github.com/Microsoft/adfsLogTools/pull/20/commits

madhavpatel6 avatar Aug 15 '18 21:08 madhavpatel6

Comment by msftclas Monday May 28, 2018 at 16:51 GMT


CLA assistant check
All CLA requirements met.

madhavpatel6 avatar Aug 15 '18 21:08 madhavpatel6

Comment by bongiovimatthew-microsoft Tuesday May 29, 2018 at 20:23 GMT


@rattuscz, this looks like a fantastic start on the PS 2.0 compat. To handle the lack of ConvertFrom-Json, you might have to construct PowerShell objects to correspond to the template that we use.

I also think you have a good point about the PS 2.0 compat code not making sense in the master branch. One downside to having a dedicated sub-branch is that it will have to be periodically updated with the latest changes going into master. It might make sense for you to maintain a forked project, which we can call out in the documentation on our project. That would mean you would be the owner, and could manage the merging of any updates.

madhavpatel6 avatar Aug 15 '18 21:08 madhavpatel6

Comment by rattuscz Tuesday May 29, 2018 at 20:54 GMT


@bongiovimatthew-microsoft I'm right in the middle of switching places inside company so in one-two months I probably won't even have access to any servers with ADFS to test it on. That would probably make me a very poor owner :slightly_frowning_face:

I will be happy to finish with replacing the json templates and any other problem I find to finish this PR as working PS2 version.

Also the line foreach ( $Event in $Result | Where { $null -ne $_ } ) - I'm not sure this is PS2 only problem, as $Result is @() + Get-WinEvent call that can lead to @() + $null which is array with null inside -> causes errors inside the foreach loop when not checked.

madhavpatel6 avatar Aug 15 '18 21:08 madhavpatel6