Closed J-Hoff389 closed 3 years ago
Are you referring to the CompanyLogo image? Does a unc or admin share path not work? I thought they should. But I think I always use http or local path.
Yes I was referring to the companyLogo image. I got it working. Was using jpg when my file was png.
Should the Match pattern allow Admin shares? Should I just not use a UNC path with a folder ending in $?
Your code Snipit:
If (($Path -match '^[A-z]:\\.*(\.png|\.jpg)$') -or ($Path -match '^\\\\*\\.*(\.png|\.jpg)$')){ If (Test-Path -Path "filesystem::$Path"){ $EncodedImage = [convert]::ToBase64String((get-content $Path -encoding byte)) }else{ Write-Error "Path not found: $path" Return $false } }