Posts

Showing posts from May, 2025

PSSDIAG Files

 ===============Confirm-FileAttributes.ps1====================== ## Copyright (c) Microsoft Corporation. ## Licensed under the MIT license. [CmdletBinding()] param ( [Parameter(Mandatory=$false)] [bool] $debug_on = $false ) function Confirm-FileAttributes { <# .SYNOPSIS Checks the file attributes against the expected attributes in $expectedFileAttributes array. .DESCRIPTION Goal is to make sure that non-Powershell scripts were not inadvertently changed. Currently checks for changes to file size and hash. Will return $false if any attribute mismatch is found. .EXAMPLE $ret = Confirm-FileAttributes #> if ($debug_on -eq $true) { $DebugPreference = "Continue" } Write-Host "Validating attributes for non-Powershell script files" # TODO: deal with ManualStart, ManualStop and pssdiag_xevent.sql $validAttributes = $true #this will be set to $false if any mismatch is fou...