diff --git a/Tools.ps1 b/Tools.ps1 index 76cbcc6..5a98b3d 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -1106,6 +1106,14 @@ Function New-TicketTimerEntry () { Create-Syncro-Ticket-TimerEntry -TicketIdOrNumber $TicketID -StartTime $StartAt -DurationMinutes $BillableMinutes -Notes $Comment -UserIdOrEmail $BillableUser -ChargeTime $ChargeTime } +# Function to get the SHA256 hash of a string +Function Get-StringHash() { + param([Parameter(Mandatory=$true,ValueFromPipeline=$true)][string]$String) + $stream = [IO.MemoryStream]::new([byte[]][char[]]$String) + $hashObj = Get-FileHash -InputStream $stream -Algorithm SHA256 + $hashObj.Hash +} + # Initial setup of the MSP management directories and log file Setup-MSPDirectories Setup-LogFile