How can I run SQL Server Vulnerability Assessment from a SQL Job?

You are getting that error because the module is not imported.

You have to use

import-module -name sqlserver  # or path to the module

see : Running PowerShell in a SQL Agent Job


The articles referenced in @Kin Shah's answer helped me to come to a final solution. I had to switch from the "PowerShell" SQL Job Type to the "Operating system (CmdExec)" Type. I moved my PowerShell command into a script and referenced that using command text like the following in a SQL Job.

powershell.exe d:\data\dev\VulnerabilityScanTest.ps1

The command inside the script ended up looking like this:

Invoke-SqlVulnerabilityAssessmentScan -ServerInstance "myserver\myinstance" -Database AdventureWorks