Wed. Jun 15th, 2022

Function ReplaceUnicodeForText([String]$FilePath)
{
    Try{

    $hashtable = @{}
    $hashtable.'%5E'='^'
    $hashtable.'%5F'='_'
    $hashtable.'%60'='`'
    $hashtable.'%20'=' '
    $hashtable.'&action=default'=''
    $hashtable.'?Web=1'=''
    $hashtable.'%2F'='/'
    $hashtable.'%21'='!'
    $hashtable.'%22'='"'
    $hashtable.'%23'='#'
    $hashtable.'%24'='$'
    $hashtable.'%25'='%'
    $hashtable.'%26'='&'
    $hashtable.'%28'='('
    $hashtable.'%29'=')'
    $hashtable.'%2A'='*'
    $hashtable.'%2B'='+'
    $hashtable.'%2C'=','
    $hashtable.'%2D'='-'
    $hashtable.'%2E'='.'
    $hashtable.'%2F'='/'

    #### Replacing text into $FilePath using the hash table ####
    Foreach ($key in $hashtable.Keys) 
    {
        $FilePath = $FilePath.Replace($key, $hashtable.$key)
    }

    Return $FilePath
    }
    Catch{
      write-host -f Red "Error Access hashtable!" $_.Exception.Message
    }

}

This website uses cookies. By continuing to use this site, you accept our use of cookies.