Skip to content

Commit

Permalink
multi user profile uploads, reduced Permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
petkir committed Oct 16, 2023
1 parent e2dc47b commit 8fde877
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/graph-update-user-photo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $imageSourcePath="c:\temp\images\"
$completeFolder="Done"
$errorFolder="Error"
Connect-MgGraph -Scopes "User.ReadWrite.All"
Connect-MgGraph -Scopes "User.ReadWrite"
if(-not(Test-Path $imageSourcePath)){
Write-Host "Image Source Path not exists, Please Check the ConfigValue imageSourcePath"
Expand All @@ -55,15 +55,15 @@ foreach($imageFile in $imageFiles){
if(-not(Test-Path $completePath)){
New-Item -ItemType Directory -Path $completePath
}
Move-Item -Path $imageFile.VersionInfo.FileName -Destination $completePath
Move-Item -Path $imageFile.VersionInfo.FileName -Destination $completePath -Force
}catch{
# Write-Host $error
$errorPath = Join-Path -Path $imageSourcePath -ChildPath $errorFolder
if(-not(Test-Path $errorPath)){
New-Item -ItemType Directory -Path $errorPath
}
$Error|Set-Content -Path "$errorPath\$username.error.txt"
Move-Item -Path $imageFile.VersionInfo.FileName -Destination $errorPath
$Error|Set-Content -Path "$errorPath\$username.error.txt"
Move-Item -Path $imageFile.VersionInfo.FileName -Destination $errorPath -Force
}
}
Expand Down

0 comments on commit 8fde877

Please sign in to comment.