I have a PowerShell script that updates document libraries to make sure that versioning is enabled:
$list.EnableVersioning = $true
How can I check whether versioning is enabled before making the change, so that I don't keep updating the list unnecessarily? I tried the following, but the syntax is incorrect:
if (list.EnableVersioning -ne $true) { $list.EnableVersioning = $true }