The following PowerShell scripts are included with SQDR and illustrate the use of the PowerShell cmdlets in the assembly SQDRPowerShell.dll. See the technical document Automating SQDR tasks using PowerShell for additional details about using PowerShell with SQDR.
PowerShell 5.1 or later is required.
Usage is documented as a comment at the beginning of each script. All of them default to connecting to the local SQDR service (127.0.0.1:7738) if the optional final parameter (host:port) is not specified.
If RBAC (Role Based Access Control) is enabled, you will need to supply credentials as part of the connection string - myuser:mypassword@host:port. For example myuser:mypassword@127.0.0.1:7738.
Some of these PowerShell scripts are used by the supplied VBScript scripts such as TargetChecker.vbs and PauseResumeIRGroup.vbs.
Actions (run, pause, resume)
The syntax for these commands are similar e.g.
Usage:
PS> ./pause-grp <IRGroupName> [host:port]"
SQL wild card % may be used within the IRGroupName
pause-grp.ps1 - pause a specific group
resume-grp.ps1 - resume a specific group
run-grp.ps1 - run (snapshot or baseline) a group
run-sub.ps1 - run (snapshot or baseline) a subscription
Configuration
dlt-sub.ps1 - delete a subscription
Usage:
PS> ./dltsub <Source> <SubscriptionName> [host:port]"
move-sub.ps1 - move a subscription between 2 paused groups
Usage
PS> ./movesub <Source> <SubscriptionName> <ToGroup>
[host:port]
Checking Status
chk-subs.ps1 - obtain the source and destination table row counts, adjusting for staged but unapplied DML. This script is use by Targetchecker.vbs.
Usage
PS> ./chksubs <IRGroupName> <SubscriptionName> [host:port]"
The SQL wild card character % may be used within the IRGroupName and SubscriptionName parameters
show-irgrp.ps1 - show incremental group properties
Usage
PS> ./show-irgrp [host:port]