The script is available for download from https://gallery.technet.microsoft.com//How-to-get-the-of-all-the-81859696. You can also use Microsoft Script Browser for Windows PowerShell ISE to download the sample with one button click from within your scripting environment.
This PowerShell script will demonstrate how to get the scripts of all the SQL Server Agent jobs.
To get all the job scripts, we need to perform the following steps: 1.Connect to SQL Server 2.Press F7 to open the Object Explorer Details 3.Select all the jobs and then right click on them 4.Select Script Job as->create job to->file But some people want to know if there is a simpler way to do it. Therefore here we provide them with a script so that they can get all the job scripts with one step.
You can find more All-In-One Script Framework script samples at https://aka.ms/onescriptingallery