This feature requires a PowerShell Pro Tools license.
Script analysis settings can be found in Tools \ Options \ PowerShell Tools \ Analysis. You can enable script analyzer, severities and individual rules.