This is for future me….as present me always forgets how to do this.

$fileSource = "C:\Temp\MyFile.txt"
$fileTarget = "C:\Temp\MyFile.zip"
& "C:\Program Files (x86)\7-Zip\7z.exe" -tzip a "$fileSource" "$fileTarget"
if ($LASTEXITCODE -ne 0) 
{ 
	Write-Output "Failed to zip $fileSource" 
	Throw "Failed to zip file $fileSource"
}