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
<# | |
1. Leaf | |
Given a text file of PDF filenames, extract content from PDFs recursively | |
and create mirror directory structure for text file outputs. | |
* Handles filenames with entry separators. | |
* Ignores PDF older than its text file mirror unless -force param is used. | |
* Requires poppler pdftotext.exe | |
.\text-mirror.ps1 -in C:\dev\abc\extract\extracted\pdfs\abc-pdfs-1.txt ` |
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
param ( | |
[int]$port, | |
[string]$ip | |
) | |
if (Test-Connection -BufferSize 32 -Count 1 -Quiet -ComputerName $ip) { | |
$socket = new-object System.Net.Sockets.TcpClient($ip, $port) | |
if ($socket.Connected) { | |
write-host "$ip is listening on port $port" |
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
# Creates new self-signed certificate for testing purposes | |
new-selfsignedcertificate -dnsname "*.domain.local" -friendlyname "*.domain.local Development Certificate" -certstorelocation "cert:\LocalMachine\My" -notafter (get-date).AddYears(100) |
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
<# | |
For each file: | |
1. take filename or portion of it, | |
2. create web-safe folder from template and filename match, | |
3. move file into new folder. | |
e.g. -format "arnpriorbylaw{0}" -take "(?m)(?i)\s*by-law\s*-\s*(\d{4}A*-\d{2})\s*-\s*.+$" => 'arnpriorbylaw1234-00' | |
#> | |
param( |
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
<# | |
sqlps dependency | |
If module sqlps does not exist, install from: | |
Microsoft SQL Server 2016 Feature Pack (https://www.microsoft.com/en-us/download/details.aspx?id=52676) | |
- SQLSysClrTypes.msi | |
- SharedManagementObjects.msi | |
- PowershellTools.msi | |
#> | |
param( |
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
<# | |
Generates a CREATE/INSERT script for a given SQL Server db table (e.g. Localizations) | |
Peter Tyrrell, Andornot, www.andornot.com | |
sqlps dependency | |
If module sqlps does not exist, install from: | |
Microsoft SQL Server 2016 Feature Pack (https://www.microsoft.com/en-us/download/details.aspx?id=52676) | |
- SQLSysClrTypes.msi | |
- SharedManagementObjects.msi | |
- PowershellTools.msi |
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
<# | |
Purges illegal XML characters from XML files in provided folder (and its subfolders). | |
Encodes out file as UTF8 without BOM. | |
Peter Tyrrell, Andornot | |
#> | |
param ( | |
[string]$indir | |
) |
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
<# | |
Picks up zip files in a given folder and extracts the contents to a destination folder. | |
Peter Tyrrell, Andornot | |
#> | |
param( | |
[Parameter(Mandatory=$true,Position=0)] | |
[string]$in, | |
[Parameter(Mandatory=$false,Position=1)] | |
[string]$out = ".", |
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
<# | |
Backs up Inmagic textbases, both SQL Server db and relevant textbase files. | |
Peter Tyrrell, Andornot, www.andornot.com | |
sqlps dependency | |
If module sqlps does not exist, install from: | |
Microsoft SQL Server 2016 Feature Pack (https://www.microsoft.com/en-us/download/details.aspx?id=52676) | |
- SQLSysClrTypes.msi | |
- SharedManagementObjects.msi | |
- PowershellTools.msi |
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 [name-of-db] | |
go | |
declare @cols AS NVARCHAR(MAX) | |
, @query AS NVARCHAR(MAX) | |
, @dechunkedRecords AS NVARCHAR(MAX) | |
, @where AS NVARCHAR(MAX); | |
set @where = '' | |
/*set @where = 'where _RecordID in ( |