#!/usr/bin/perl -w use strict; my $un = 'steve gilbert'; my $jpeg = 'v:/employee photos/out/steve gilbert.jpg'; my $result = `c:\\windows\\system32\\windowspowershell\\v1.0\\powershell.exe -command "Set-ADUser $un -Replace @{thumbnailPhoto=([Byte[]](Get-Content $jpeg -Encoding Byte))}"`; #### syntax error at C:\Users\steveg\adimg-test.pl line 5, near "Byte[" Execution of C:\Users\steveg\adimg-test.pl aborted due to compilation errors.