Converted into a module: https://github.com/tcartwright/tcdbtools
PS Gallery link: https://www.powershellgallery.com/packages/tcdbtools/
# ignore update help exceptions, and just continue on updating help. throw the exception at the end if there was one | |
Update-Help -Force -ErrorAction Continue -ErrorVariable uhex | |
if ($uhex) { | |
throw $uhex.Exception | |
} |
@rem bat file to ease use of the script | |
@%~d0 | |
@cd "%~dp0" | |
winget export --output "%~dp0apps_temp.json" --accept-source-agreements |
Clear-Host | |
# scanning winget is not perfect, but it allows you to get a list of packages avaialable from the winget store in alphabetical order. | |
# seems to have an issue with parsing non-english languages, possibly because of the unicode byte width | |
$includeUnicodeResults = $false #change this to include or exclude them from the results | |
$results = winget search --query `"`" | | |
Select-Object -Skip 3 | | |
ForEach-Object { |
#Requires -RunAsAdministrator | |
Clear-Host | |
<# | |
AUTHOR: Tim Cartwright | |
Puprose: Turns on split tunneling for a VPN, and then adds all routes for the VPN. Subnets can be added or all A records from DNS | |
NOTES: Look for all parts with a "# CHANGE ME" comment, and change those to match your scenario | |
#> |
class TrustAllCertsPolicy : System.Net.ICertificatePolicy { | |
[bool] CheckValidationResult([System.Net.ServicePoint] $a, | |
[System.Security.Cryptography.X509Certificates.X509Certificate] $b, | |
[System.Net.WebRequest] $c, | |
[int] $d) { | |
return $true | |
} | |
} | |
[System.Net.ServicePointManager]::CertificatePolicy = [TrustAllCertsPolicy]::new() | |
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 |
Converted into a module: https://github.com/tcartwright/tcdbtools
PS Gallery link: https://www.powershellgallery.com/packages/tcdbtools/
/*****MODIFY QUERY ************************/ | |
DECLARE @TheQuery NVARCHAR(MAX) = '<PLACE YOUR QUERY HERE>' | |
/*****MODIFY QUERY ************************/ | |
/**************************************************************/ | |
-- DO NOT MODIFY BELOW THIS LINE | |
/**************************************************************/ | |
SET NOCOUNT ON |
SET NOEXEC OFF; | |
GO | |
IF EXISTS ( | |
SELECT 1 | |
FROM [sys].[dm_xe_sessions] | |
WHERE [name] = 'Deadlock_Monitor' | |
) BEGIN | |
DROP EVENT SESSION [Deadlock_Monitor] ON SERVER; | |
RAISERROR(' Deadlock_Monitor Event Removed', 0, 1) WITH NOWAIT; |
This job is designed to send any new error logs to a Graylog server. Each time it runs the last date/time of the very last error in the log is recorded and is then used on the following run to only retrieve errors after the cut off date time.
TO USE:
OPTIONALLY: From a single server, you could loop a list of servers and call this powershell with each of the server names.