Thursday, 3 September 2015

How to convert C# bool to Javascript boolean in Razor .cshtml views

I was wanting a clean way to convert a C# Boolean property on a view model into a javascript true / false bit of text for passing into our Typescript context settings constructors, and stumbled upon this way …

@Json.Encode(Model.BoolPropertyName)

clip_image002

Works a treat too!

clip_image004

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...