2014-06-13 4 views
0

현재 PowerShell을 통해 비즈니스 인텔리전스 SharePoint 사이트에 브랜딩 변경 사항 배포를 자동화하려고합니다. 다음 코드를 사용하여 테스트를 위해 SharePoint의 로컬 인스턴스에 WSP를 배포합니다. 내가 중앙 관리에서 그것을에서 볼 수 PowerShell을 사용하여 SharePoint에 CSS 배포

function Uninstall-AllSPSolutions { 
param (
    [switch] $Local, 
    [switch] $Confirm 
) 

Start-SPAssignment -Global; 
foreach($solution in (Get-SPSolution | Where-Object { $_.Deployed })) { 
    write-host "Uninstalling Solution " $solution.Name; 
    if($solution.DeployedWebApplications.Count -gt 0) { 
     Uninstall-SPSolution $solution -AllWebApplications -Local:$Local -Confirm:$Confirm; 
    } else { 
     Uninstall-SPSolution $solution -Local:$Local -Confirm:$Confirm; 
    } 
    do { 
     Start-Sleep 5; 
     $solution = Get-SPSolution $solution; 
     } while($solution.JobExists -and $solution.Deployed) 
} 
Stop-SPAssignment -Global; 
} 

function Remove-AllSPSolutions { 
param (
    [switch] $Confirm 
) 
Get-SPSolution | Where-Object { !$_.Deployed } | Remove-SPSolution -Confirm:$Confirm 
} 

echo "Loading Sharepoint Snapin" 
$snapin = Get-PSSnapin | Where-Object { $_.Name -eq "Microsoft.SharePoint.Powershell" } 
if ($snapin -eq $null) { 
    Write-Host "[INIT] Loading SharePoint Powershell Snapin" 
    Add-PSSnapin "Microsoft.SharePoint.Powershell" 
} 

#Some variables 
#Include Url Site 
$SITEURL="sharepoint url" 
#Include WSP File Path 
$WSPFILEPATH="C:\Users\Administrator\Desktop\folder\SharepointDeployer.wsp" 
#Include WSP Name 
$WSPNAME="SharepointDeployer.wsp" 

echo "Uninstall Solutions" 
Uninstall-AllSPSolutions -Confirm 
echo "Remove Solutions" 
Remove-AllSPSolutions -Confirm 

echo Deploy Test solution 
echo "1. Add Solution" 
Add-SPSolution $WSPFILEPATH 
echo "2. Deploy Solution" 
#Install-SPSolution -identity $WSPNAME -force -AllWebApplications $SITEURL -GACDeployment 
Install-SPSolution -identity $WSPNAME -force -AllWebApplications -GACDeployment 
echo "2. Enable Feature" 
Enable-SPFeature –Identity "SharepointDeployer Feature1" –url $SITEURL 

솔루션

은 잘 배치,하지만 난 SharePoint 디자이너에서 볼 때 변경이 파일을 변경되지 않습니다.

모든 파일

IgnoreIfAlreadyExists="true" Type="GhostableInLibrary" 

내가 거기에 문제가 있는지 확인하기 위해 기능과 장난 시도 모듈에 덮어 쓰려면 다음과 같은 속성을 가지고, 여기에 결과

농장입니다 : Visual Studio를 통해 WSP를 생성 할 수 없습니다. 이 오류는 프로젝트 항목은 "모듈의 이름은"농장의 범위와 기능을 통해 배포 할 수 없습니다 입니다

사이트 : 기능이 농장 레벨의 기능이 아닙니다하고 URL에 의해 정의 된 사이트 수준에없는

웹 : 동일

웹 응용 이상과 같이이 웹 응용 범위를

을 말한다 제외하고 내가 농장과 같은 오류가 나는 우리가 (내가이 간단해야로서,이 작품을 만들기 위해 무엇을해야하는지 확실하지 않다 CSS 파일 3 개, 이미지 2 개, 마스터 페이지 이야기)

도움이 될 것입니다. 제 생각에는

답변

0

은 자원에 대한 두 가지 이유가 오래된

  • 당신이 사용자 지정 변경을 유지 할 수있다. 파일을 하이브에 배포하지만 가상 폴더에 사이트 정의가 표시되지 않습니다. 스크립트에서 사이트 정의로 리소스를 되돌리기 위해 코드를 추가하여
  • 기능을 비활성화하지 않도록 할 수 있습니다. 솔루션을 철회하고 다시 배포하면 기능이 제대로 업데이트되지 않고 SharePoint가 모든 기능을 활성화했다고 생각할 것입니다. 철회하기 전에 비활성화 전화를 추가해야합니다.

좋은 kuck