Boolean parameter -Enabled $true

I am asking about this video:

At 18:24, there is a parameter created for New-AdUser. It is:
-Enabled $([System.Convert]::ToBoolean($user.Enabled))

I followed the discussion regarding how to retrieve the boolean values. However, for that parameter, why not just use -Enabled $true instead of the one used in the video? When we create users in our org, we just use -Enabled $true.

On the MS documentation

this example is given:
New-ADUser -Name “ChewDavid” -Accountpassword (Read-Host -AsSecureString “AccountPassword”) -Enabled $true

Could I get some clarification on $([System.Convert]::ToBoolean($user.Enabled))

Interesting. I have been looking at your post for couple of days and I know as well the second one works when using -Enabled $true. It is even on the link provided. My guess is that the execution form PowerShell you can type it using -Enabled $true but not when adding it via an import script using CSV.

Check the following link:

The first command provides a more flexible way of setting the -Enabled parameter based on the value of the $user.Enabled property, while the second command sets the -Enabled parameter to a fixed value of true .

Thanks for the response. The link you posted is very interesting. In the video I referenced, the value isn’t in a csv, right? It’s just in his ISE script. That would mean the question is still outstanding. Why isn’t he just using $true?

Yes, it is a csv and creating the ps1 from ISE but let me add @ServerAcademy to the thread for his comments.