Binary Code in a Variable

Welcome Forums General PowerShell Q&A Binary Code in a Variable

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
1 year, 3 months ago.

  • Author
    Posts
  • #73615

    Participant
    Points: 0
    Rank: Member

    Is it possible to load a variable array with binary code? In particular, I want to load profile photos into an array and assign them as needed. Thanks for any guidance.

  • #73618

    Participant
    Points: 0
    Rank: Member

    Do you mean something like

    $Pictures = [System.IO.File]::ReadAllBytes("C:\Users\user1\Pictures\picture1.jpg"),
    [System.IO.File]::ReadAllBytes("C:\Users\user2\Pictures\picture2.jpg"),
    [System.IO.File]::ReadAllBytes("C:\Users\user3\Pictures\picture3.jpg")
    
  • #73967

    Participant
    Points: 0
    Rank: Member

    @Curtis, that is exactly what I needed. Thank you!

The topic ‘Binary Code in a Variable’ is closed to new replies.