Last active
March 5, 2024 10:02
-
-
Save TakashiSasaki/3972d1c76bb31ba0dbde767e25c1c247 to your computer and use it in GitHub Desktop.
This file contains 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
# Get the current directory | |
$currentDirectory = Get-Location | |
# Output the current directory | |
Write-Output "Test" | |
Write-Output "Current Directory: $currentDirectory" | |
# Encode in UTF-8 | |
$utf8Encoded = [System.Text.Encoding]::UTF8.GetBytes($currentDirectory) | |
# Calculate MD5 hash | |
$md5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider | |
$hashBytes = $md5.ComputeHash($utf8Encoded) | |
# Output the hash value (no hyphen, lowercase) | |
$hash = [System.BitConverter]::ToString($hashBytes).Replace("-", "").ToLower() | |
Write-Output "MD5 Hash: $hash" | |
# Get the current date and time | |
$currentDateTime = Get-Date | |
# Create a string representing the date and time as an 8-digit integer | |
$dateString = "{0:D2}{1:D2}{2:D2}" -f $currentDateTime.Year, $currentDateTime.Month, $currentDateTime.Day | |
# Output the date and time | |
Write-Output "Current Date and Time: $dateString" | |
# Create the filename | |
$filename = "$hash-$dateString.efu" | |
Write-Output $filename | |
# Execute the es.exe command | |
if (Get-Command es.exe -ErrorAction SilentlyContinue) { | |
& es.exe -path . -export-efu $filename | |
} else { | |
& .\es.exe -path . -export-efu $filename | |
} | |
# Pause until the user presses any key | |
#Read-Host "Press any key to continue after checking the result" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment