Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit a873cb8

Browse files
Create run-windows-powershell-steps-in-sql-server-agent.md
ms.date, headings
1 parent 4fe7fdf commit a873cb8

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

docs/powershell/run-windows-powershell-steps-in-sql-server-agent.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: markingmyname
88
ms.author: maghan
99
ms.reviewer: matteot, drskwier
1010
ms.custom: seo-lt-2019
11-
ms.date: 03/16/2017
11+
ms.date: 11/19/2021
1212
---
1313

1414
# Run Windows PowerShell Steps in SQL Server Agent
@@ -21,7 +21,7 @@ Use SQL Server Agent to run SQL Server PowerShell scripts at scheduled times.
2121

2222
[!INCLUDE[sql-server-powershell-no-sqlps](../includes/sql-server-powershell-no-sqlps.md)]
2323

24-
## To run PowerShell from SQL Server Agent
24+
## Run PowerShell from SQL Server Agent
2525

2626
There are several types of SQL Server Agent job steps. Each type is associated with a subsystem that implements a specific environment, such as a replication agent or command prompt environment. You can code Windows PowerShell scripts, and then use SQL Server Agent to include the scripts in jobs that run at scheduled times or in response to SQL Server events. Windows PowerShell scripts can be run using either a command prompt job step or a PowerShell job step.
2727

@@ -35,7 +35,7 @@ Each SQL Server Agent job step that runs PowerShell with the **sqlps** module la
3535

3636
## <a name="PShellJob"></a> Create a PowerShell Job Step
3737

38-
### To create a PowerShell job step
38+
### Create a PowerShell job step
3939

4040
1. Expand **SQL Server Agent**, create a new job or right-click an existing job, and then select **Properties**. For more information about creating a job, see [Creating Jobs](../ssms/agent/create-jobs.md).
4141

@@ -53,7 +53,7 @@ Each SQL Server Agent job step that runs PowerShell with the **sqlps** module la
5353

5454
## <a name="CmdExecJob"></a> Create a Command Prompt Job Step
5555

56-
### To create a CmdExec job step
56+
### Create a CmdExec job step
5757

5858
1. Expand **SQL Server Agent**, create a new job or right-click an existing job, and then select **Properties**. For more information about creating a job, see [Creating Jobs](../ssms/agent/create-jobs.md).
5959

@@ -67,7 +67,7 @@ Each SQL Server Agent job step that runs PowerShell with the **sqlps** module la
6767

6868
6. In the **Process exit code of a successful command** box, enter a value from 0 to 999999.
6969

70-
7. In the **Command** box, enter commands beginning with PowerShell.exe with parameters specifying the PowerShell script to be run. These examples are similar to the syntax for executing PowerShell commands from a Windows command prompt. Refer to `PowerShell.exe -?` for all the possible syntax options.
70+
7. In the **Command** box, enter PowerShell.exe with parameters specifying the PowerShell script to be run. This is pretty much what you would write at a cmd command prompt, so take a look at `PowerShell.exe -?` for all the possible options.
7171

7272
- Example 1: Runs a simple cmdlet.
7373
```cmd
@@ -82,7 +82,7 @@ Each SQL Server Agent job step that runs PowerShell with the **sqlps** module la
8282
PWSH.exe -ExecutionPolicy RemoteSigned -File X:\MyScripts\script001.ps1
8383
```
8484
85-
8. select the **Advanced** page to set job step options, such as: what action to take if the job step succeeds or fails, how many times SQL Server Agent should try to execute the job step, and the file where SQL Server Agent can write the job step output. Only members of the **sysadmin** fixed server role can write job step output to an operating system file.
85+
8. Select the **Advanced** page to set job step options, such as: what action to take if the job step succeeds or fails, how many times SQL Server Agent should try to execute the job step, and the file where SQL Server Agent can write the job step output. Only members of the **sysadmin** fixed server role can write job step output to an operating system file.
8686
8787
## See Also
8888

0 commit comments

Comments
 (0)