【发布时间】:2020-08-05 01:54:51
【问题描述】:
我尝试在每次使用 GitHub 操作推送到我的 GitHub 存储库时部署到 siteCollection appcatalog。看到可以使用Office 365 CLI 操作,但只允许租户管理员部署。
在运行 powershell 脚本之前,我构建并创建了 .sppkg 文件。
所以我在 GitHub 操作中使用了 PowerShell 的 SharePointPnPPowerShellOnline 模块。我能够连接到该站点。
我无法找到访问 .sppkg 文件并将其部署到站点的方法
文件夹结构
下面是我的代码
Install-Module -Name SharePointPnPPowerShellOnline -Force -Verbose -Scope CurrentUser
$siteUrl = "https://test.sharepoint.com"
$username = "xyz@abc.com"
$password = "myPassword"
$encpassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$cred = New-Object -typename System.Management.Automation.PSCredential -argumentlist $username, $encpassword
Connect-PnPOnline -Url $siteUrl -Credentials $cred
Write-Host "logged in"
#code to access the sppkg file and deploy it to the site collection appcatalog
--------------------------------------------------------------------------------
$getTheSPPKGFile = *************
Add-PnPApp -Path $theSPPKGFile -Publish -Overwrite
--------------------------------------------------------------------------------
任何搜索都会导致租户管理方法。我没有租户管理员权限,只有网站集管理员权限。
谢谢
【问题讨论】:
标签: powershell sharepoint-online github-actions spfx