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
// Types for the result object with discriminated union | |
type Success<T> = { | |
data: T; | |
error: null; | |
}; | |
type Failure<E> = { | |
data: null; | |
error: E; | |
}; |
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
$tenantId = "00000000-0000-0000-0000-000000000000" # Replace with your tenant ID | |
$graphApiAppId = "00000003-0000-0000-c000-000000000000" # Well known ID | |
$msiName = "MSINAME" # Name of your managed identity e.g. name of Function or Logic App | |
$graphPermissions = @("Directory.Read.All", "User.Read.All") # Add or remove permissions | |
Connect-AzureAD -TenantId $tenantId | |
$msi = Get-AzureADServicePrincipal -Filter "displayName eq '$msiName'" # Can take a few seconds, add a sleep if necessary | |
$graphApiAppRegistration = Get-AzureADServicePrincipal -Filter "appId eq '$graphApiAppId'" | |
$appRoles = $graphApiAppRegistration.AppRoles | Where-Object { $graphPermissions -contains $_.Value -and $_.AllowedMemberTypes -contains "Application" } | |
foreach ($appRole in $appRoles) { |
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
#Here is a simple script to hash a string using your chosen cryptography algorithm. | |
#Usage Examples: | |
#Get-StringHash "My String to hash" "MD5" | |
#Get-StringHash "My String to hash" "RIPEMD160" | |
#Get-StringHash "My String to hash" "SHA1" | |
#Get-StringHash "My String to hash" "SHA256" | |
#Get-StringHash "My String to hash" "SHA384" | |
#Get-StringHash "My String to hash" "SHA512" | |
#http://jongurgul.com/blog/#Get-StringHash-get-filehash/ |
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
#!/usr/bin/env python3 | |
""" | |
2025 update: | |
- Recursive extraction from nested EML files | |
- Robust filename handling with sanitization and deduplication | |
- Proper logging instead of print statements | |
- Enhanced error handling and validation | |
- Binary file reading for better encoding support | |
- Cross-platform filename compatibility |