PowerShell Sharepoint 2013应用程序目录
我已经创建了几个SharePoint托管的应用程序。是否可以创建批量应用程序目录,因为该应用程序仅为100个客户端创建。我找不到可用于Sharepoint office 365网站目录的PowerShell命令 也可以使用PowerShell上传批量应用程序。在网上找不到太多信息 也许这里有人有什么建议 干杯,PowerShell Sharepoint 2013应用程序目录,shell,sharepoint,powershell,sharepoint-2013,Shell,Sharepoint,Powershell,Sharepoint 2013,我已经创建了几个SharePoint托管的应用程序。是否可以创建批量应用程序目录,因为该应用程序仅为100个客户端创建。我找不到可用于Sharepoint office 365网站目录的PowerShell命令 也可以使用PowerShell上传批量应用程序。在网上找不到太多信息 也许这里有人有什么建议 干杯, Kris可以将应用程序批量上传到Office 365环境,就像SharePoint内部部署一样。 这里棘手的部分是,你必须将应用程序上传到应用程序目录,它实际上是一个文档库 最近,我使用
Kris可以将应用程序批量上传到Office 365环境,就像SharePoint内部部署一样。 这里棘手的部分是,你必须将应用程序上传到应用程序目录,它实际上是一个文档库 最近,我使用互联网上的脚本创建了一个函数。发布了以下功能:
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
}
所以这只能在内部前提下实现?在Sharepoint Online(Office 365)中,这是不可能的?您是否已经成功,或者这对您来说仍然是一个问题?Sharepoint Online尚未成功。所以这仍然是个问题。