Skip to main content

Notifications

Community site session details

Community site session details

Session Id : ZOqplScditswqK3yrTfzEl
Power Automate - Power Automate Desktop
Answered

How to Convert Text to MD5

Like (1) ShareShare
ReportReport
Posted on 29 Nov 2024 02:55:35 by 6
I ask copilot to write me a script, but it always gives me an error. 
Categories:
  • CU29110252-0 Profile Picture
    6 on 29 Nov 2024 at 11:32:38
    How to Convert Text to MD5
    My input text is different, but the output is the same as yours. 
  • Verified answer
    VishnuReddy1997 Profile Picture
    2,324 Super User 2025 Season 1 on 29 Nov 2024 at 06:53:12
    How to Convert Text to MD5
     
    Please find the solution as shown in image.
     
     
    Code:
    Please find the below powershell code.
    param (
        [string]$NewVar
    )
    
    function Get-MD5Hash($input) {
        $md5 = [System.Security.Cryptography.MD5]::Create()
        $bytes = [System.Text.Encoding]::UTF8.GetBytes($input)
        $hash = $md5.ComputeHash($bytes)
        $hashString = [BitConverter]::ToString($hash) -replace '-', ''
        return $hashString
    }
    
    $md5Hash = Get-MD5Hash -input $NewVar
    Write-Output $md5Hash
     
    (Note:- if you got your solution you can mark as solution and gives kudos)
     
    Thanks & Regards
    Vishnu Reddy

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 11 Super User 2025 Season 1

#2
KO-05050229-0 Profile Picture

KO-05050229-0 4

#2
John_Mavridis Profile Picture

John_Mavridis 4 Microsoft Employee

Overall leaderboard