Thursday, July 26, 2018

Powershell Rest Calls (invoke-restapi) fail with latest versions - Force TLS

If you start experiencing Rest-call failures in PowerShell (Invoke-RestApi, Invoke-WebRequest, ...), you should realize that NetApp has dropped SSL support.

So you must force TLS now.

This is done by adding this code at the beginning :

# Force TLS
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Wednesday, July 25, 2018

Tuning WFA 4.2

My collegue José is working on one of the largest WFA installs I know of and he told me this after migrating from 4.0 to 4.2 :


After a migration from WFA 4.0 to a different server on WFA 4.2 we started to see slowness up to the point where the application was unusable.

The execution log was taking minutes to populate, and when it was populating for one user, the rest could do nothing, get timeout errors and messages about "server busy".

Tuesday, July 24, 2018

Grab WFA execution log with powershell

For logging purposes, you might want the need to grab a WFA execution log.  I initially wrote this to dump those in an OCI database, but for this post, I narrowed it down to just dumping them in CSV-files (jobinfo, input parameters & return parameters).  The original script also updates statuses (for example, when a jobstatus changes from failed => resume => completed), but that compare is only possible when we dump in a database and i can query it again, so for this csv-output method, an update won't work (but I kept the code in comment).

I did make the script incremental.  Job logs can take a while to grab, so I allow a timeout.  I keep the last jobid in a simple text-file.  Original, obviously, I stored this in the database.  I you are interested in the the database version, give me a ping.


Friday, July 20, 2018

Get rid of Get-WfaLogger and override Write-Host

A customer recently asked if it's possible to override write-host, avoiding Get-WfaLogger and thus be able to convert existing PowerShell scripts to Wfa-commands by a simple copy-paste.

I tried it, and yes it's possible.  Well, you would still need to add 2-lines of code, and this doesn't necessarily mean that you can just copy paste any piece of code in there (for example the parameters of your script must be strong-typed and must match the support parameters, there are other native wfa cmdlets like "connect-wfacluster", ...)