Forum
Bildirimler
Hepsini Temizle
Microsoft Azure
1
Yazılar
1
Üyeler
0
Reactions
38
Görüntüleme
Konu başlatıcı
Selam,
AzCopy.exe kullanarak bir PowerShell kodu aracılığıyla Intune'a uygulama yüklemeye çalışıyorum. Aslında uygulamanın metadatası oluşuyor; yani Intune’a baktığımda uygulamanın adı, install/uninstall komutları, detection method vs. gibi ayarları geliyor. Ancak bir türlü Win32 uygulaması tamamen yüklenmiyor, "Committing" kısmında takılı kalıyor bu konuda bir fikri olan varmi acaba ?
Kod çok uzun, ancak AzCopy adımını burada kullanıyorum. Aşağıdaki kodu kullanıyorum:
# Upload to Azure Storage
Write-Host "Creating File Content..." -ForegroundColor Yellow
$fileContent = @{
"@odata.type" = "#microsoft.graph.mobileAppContentFile"
name = "IntunePackage.intunewin"
size = $Size # Integer türünde olmalı
sizeEncrypted = $EncrySize # Integer türünde
isDependency = $false
manifest = $null
}
$uriFileContent = "https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/$($appCreated.id)/microsoft.graph.win32LobApp/contentVersions/$($contentVersionCreated.id)/files"
$fileContentCreated = Invoke-MgGraphRequest -Method POST -Uri $uriFileContent -Body ( $fileContent | ConvertTo-Json)
# Durumu kontrol et ve bekle
do {
Start-Sleep -Seconds 5
$uriFileStatus = "https://graph.microsoft.com/beta/deviceAppManagement/mobileApps/$($appCreated.id)/microsoft.graph.win32LobApp/contentVersions/$($contentVersionCreated.id)/files/$($fileContentCreated.id)"
$fileStatus = Invoke-MgGraphRequest -Method GET -Uri $uriFileStatus
} while ($fileStatus.uploadState -ne "azureStorageUriRequestSuccess")
Write-Host "Created File Content" -ForegroundColor Green
Write-host ""
# AzCopy ile dosya yükleme fonksiyonu
$env:AZCOPY_LOG_LOCATION=$logPathAzCopy
function Upload-UsingAzCopy {
param (
[string]$fileToUpload,
[string]$destinationUri
)
if (!(Test-Path $toolPathAzCopy)) {
Write-Host "AzCopy.exe bulunamadı. Lütfen AzCopy'yi yükleyip tekrar deneyin."
exit 1
}
Write-Host "AzCopy.exe kullanılarak dosya Azure Blob'a yükleniyor" -ForegroundColor White
& $toolPathAzCopy copy $fileToUpload $destinationUri --recursive=true
if ($?) {
Write-Host "Uygulama içeriği AzCopy.exe ile başarıyla yüklendi." -ForegroundColor Green
} else {
Write-Host "Uygulama içeriği AzCopy.exe ile yüklenemedi." -ForegroundColor Red
}
}
# AzCopy ile yükleme
Write-Host "Uygulama içeriği AzCopy.exe kullanılarak Azure Blob'a yükleniyor" -ForegroundColor Yellow
Upload-UsingAzCopy -fileToUpload $IntuneWinFile -destinationUri $fileStatus.azureStorageUri
Gönderildi : 21/03/2025 08:56