2014-03-28 2 views
1

여러 개의 SharePoint 호스트 응용 프로그램을 만들었습니다. 앱이 약 100 명의 고객을 위해 생성되기 때문에 일괄 앱 카탈로그를 만들 수 있습니까? 나는 Sharepoint office 365 사이트 카탈로그를 위해 그것을 할 수있는 PowerShell 명령을 찾지 못했습니다.PowerShell Sharepoint 2013 응용 카탈로그

PowerShell을 사용하여 대량 응용 프로그램을 업로드 할 수 있습니까? 웹에서 많은 정보를 찾지 마십시오.

여기 누구에게 조언이 있습니까?

건배, 크리스

+0

이미 성공했거나 여전히 문제가 있습니까? –

+0

아직 SharePoint Online 용입니다. 그래서 여전히 문제입니다. – user3396761

답변

0

는 온 - 프레미스 for SharePoint를 그대로는 오피스 365 환경에 대량 업로드 응용하는 것이 가능하다. 여기 까다로운 부분은 실제로 앱 라이브러리 인 앱 카탈로그에 앱을 업로드해야한다는 것입니다.

최근 인터넷에서 스크립트를 사용하여 함수를 만들었습니다. 아래 함수를 게시하십시오 :

function UploadAppToCatalog    
    {    
    [CmdletBinding()]    
    Param(   
    [Parameter(Mandatory=$true,ValueFromPipeline=$true)]    
    [string]$webUrl,    
    [Parameter(Mandatory=$true)]    
    [string]$DocLibName,    
    [Parameter(Mandatory=$true)]    
    [string]$FilePath    
    )     

    Start-SPAssignment -Global    
    $spWeb = Get-SPWeb -Identity $webUrl    
    $spWeb.AllowUnsafeUpdates = $true;    
    $List = $spWeb.Lists[$DocLibName]    
    $folder = $List.RootFolder    
    $FileName = $FilePath.Substring($FilePath.LastIndexOf("\")+1)    
    $File= Get-ChildItem $FilePath    
    [Microsoft.SharePoint.SPFile]$spFile = $spWeb.GetFile("/" + $folder.Url + "/" + File.Name)    
    $flagConfirm = 'y'    
    if($spFile.Exists -eq $true)    
    {    
     $flagConfirm = Read-Host "File $FileName already exists in library $DocLibName, do you want to upload a new version(y/n)?"    
    }    

    if ($flagConfirm -eq 'y' -or $flagConfirm -eq 'Y')    
    {    
     $fileStream = ([System.IO.FileInfo] (Get-Item $File.FullName)).OpenRead()    
     #Add file    
     write-host -NoNewLine -f yellow "Copying file " $File.Name " to " $folder.ServerRelativeUrl "..."    
     [Microsoft.SharePoint.SPFile]$spFile = $folder.Files.Add($folder.Url + "/" + $File.Name, [System.IO.Stream]$fileStream, $true)    
     write-host -f Green "...Success!"    
     #Close file stream    
     $fileStream.Close()    
     write-host -NoNewLine -f yellow "Update file properties " $spFile.Name "..."    
     $spFile.Item["Title"] = "Document Metrics Report"    
     $spFile.Item.Update()    
     write-host -f Green "...Success!"    
    }    
    $spWeb.AllowUnsafeUpdates = $false;    


    Stop-SPAssignment -Global    
} 
+0

그래서 On-Premise에서만 가능합니까? 셰어 포인트 온라인 (Office 365)에서는 불가능합니다. – user3396761