Run Powershell Script as Agent Job


You can setup Agent job Step to run Powershell script in
either Type as Operating system (CmdExec) or Type as PowerShell.

A sample Command for CmdExec:
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -ExecutionPolicy ByPass -command ” powershell ‘C:\temp\call_backup_cmdlet_with_parameter.ps1’ ‘myDB1,myDB2’ ”

For Type as Powershell:
Type: Powershell
Command:
C:\temp\call_backup_cmdlet_with_parameter.ps1

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s