This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This only works if you have CIM, WMI, and task change privileges on the remote host servers. | |
# List the known hosts, and for each host their known scheduled task paths. | |
# We're only interested in production task paths - no need to specify test task paths. | |
# (You did separate those, didn't you?) | |
# | |
# The host name is just the NetBUI name: no slashes, ports, protocols, or paths. | |
# The scheduled task path starts with a backslash (which stands for Task Scheduler -> Task Scheduler Library) | |
# and then follows the hierarchy you see in the task scheduler. Use a wildcard * to include any task in a path. | |
$taskHostPaths = @{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use Common Table Expressions when Unit Testing in TSQL | |
TSQL, Microsoft's SQL dialect for SQLServer, is capable of executing CTE, also known as Common Table Expression. | |
We can use these to separate concerns when setting up unit tests, like so, to determine whether a new process | |
returns the same records as an old process: | |
WITH old_batch (found) as (SELECT FIELD AS found FROM OLD_QUERY_OR_PROCESS), | |
new_batch (found) as (SELECT FIELD AS found FROM NEW_QUERY_OR_PROCESS), | |
compare_old_to_new (found) as (select found from old_batch where found not in (select found from new_batch)), | |
compare_new_to_old (found) as (select found from new_batch where found not in (select found from old_batch)), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use IFF for field expressions in TSQL | |
TSQL, Microsoft's SQL dialect for SQLServer, does not accept simple equations and expressions in place of its fields. | |
So this it won't execute: | |
SELECT NAME='aev-mambro2' as Found FROM USERS; | |
Instead, Microsoft wants us to use IIF as a field expression, like so: |
NewerOlder