2011-03-24 2 views
1

직장에서 TFS Deployer currenlty를 설정하고 배포 용 Powershell 스크립트를 작성하려고했습니다. 나는 StackoverFlow에서 많은 질문과 답변을 연구하고 읽었지만 스크립트를 아직 만들지 못했습니다.Powershell의 MSdeploy - 실제 작동하는 것을 보여 주거나 도와주세요.

지금까지 Windows PowerShell ISE에서 다음 PS를 실행하면 실행됩니다.

ENV $ envMsDeploy = $ : \ 프로그램 파일 \ IIS \ 마이크로 소프트 웹 배포 V2
: msdeploy
$ DirMsDeploy = 분할 경로 -parent $ envMsDeploy

#은 $ DirMSDeploy에 = C를 현재의 위치를 ​​정의 세트 로케이션 $ DirMsDeploy

ARG = $ @ (
'- 동사 : 동기화']
'-source : contentPath를 ='+ $ buildDroppedLocation]
'-dest : contentPath ='+ $ destinationPath;
'-whatif> C : \ 임시 \의 msdeploy.log'
)


$ runMSDeploy = ($ DirMsDeploy + "\ Msdeploy.exe"+ $ ARG)
$ runMSDeploy를 | out-file c : \ temp \ MsDeployTest.bat

마지막 문장을 저장하면 $ runMSDeploy가 저장되는지 확인합니다. 이제 $ runMSDeploy는 내가 원하는 것을 저장합니다.

MSDeployTest.Bat에 C : \ Program Files \ IIS \ Microsoft Web Deploy V2 \ Msdeploy.exe -verb가 포함되어 있습니다. sync -source : contentPath = [[c : \ source folder]] -dest : contentPath = [[Detination UNC 경로]] -whatif> c : \ temp \ msdeploy.log

여기가 지금 당장 붙어 있습니다. c : \ Program 파일에 빈 폴더가 있기 때문에 "cmd.exe : 'C : \ Program'이 내부 또는 외부 명령으로 인식되지 않습니다."

제안이나 아이디어가 있으시면 알려주세요.

감사

wanttogoshreddingeveryday 여기

+0

ENV $ envMsDeploy = $ : \ 프로그램 파일 \ IIS \ 마이크로 소프트 웹 배포 V2 설정 - 위치 $의 DirMsDeploy : msdeploy $ DirMsDeploy = 분할 경로 -parent $ envMsDeploy #은 C로 현재 위치를 정의 ARG = $ @ ( '- 동사 : 동기'; '-source : contentPath를 ='+ $ buildDroppedLocation; '-dest : contentPath를 ='+ $의 DestinationPath; '-whatIf> C : \ 임시 \ msdeploy.log ' ) $ runMSDeploy = ($ DirMsDeploy + "\ Msdeploy.exe"+ $ arg) wanttogoshreddingeveryday

+1

#BEGIN $ MsDeployDir = (Get-ItemProperty -Path HKLM : \ SOFTWARE \ Microsoft \ .NETFramework \ AssemblyFolders \ MSDeploy). '(기본값) ' $ MsDeployExe = $ MsDeployDir | 연결 경로 -ChildPath msdeploy.exe & cmd.exe/c $ (' ""{0} "-verb : sync -source : contentPath ="{1} "-dest : contentPath ="{2} "-whatif "-f $ MSDeployExe, $ BuildDroppedLocation, $ DestinationPath) #END – wanttogoshreddingeveryday

+0

TFS 배포자를 개발 한 Jason Stangroome이 여기에서 나를 도왔습니다. http://tfsdeployer.codeplex.com/discussions/251531 – wanttogoshreddingeveryday

답변

0

이 요지를 시도해보십시오 parametter

function F([string]$file) 
{ 
    notepad.exe $file 
} 

Clear-Host 
F "c:\Temp\fic.txt" 

JP

0

으로 NOTEPAD.EXE 시작 작은 예이다. powershell을 통해 배포해야하는 모든 것이 있어야합니다. https://gist.github.com/579086

Psake를 사용하지만 잘 작동하지 않을 수도 있습니다.

+0

감사합니다. Rarous. – wanttogoshreddingeveryday

+0

$ envMsDeploy = $ ENV : msdeploy $ DirMsDeploy는 = 분할 경로 -parent $ envMsDeploy #은 C로 현재 위치를 정의 : \ 프로그램 파일 \ IIS \ 마이크로 소프트 웹 배포 V2 설정 - 위치 $ DirMsDeploy $ ARG = @ ( '- 동사 : 동기'; '-source : contentPath를 ='+ $ buildDroppedLocation; '-dest : contentPath를 ='+ $의 DestinationPath; '-whatIf> C : \ 임시 \ msdeploy.log' ) $ runMSDeploy = ($ DirMsDeploy + "\ Msdeploy.exe"+ $ arg) – wanttogoshreddingeveryday

+0

이제 $ runMSDeploy에 필요한 모든 항목을 저장할 수 있습니다. 그런 다음 나머지 매개 변수와 함께이 msdeploy.exe를 실행하는 데 사용할 수있는 다른 명령은 무엇입니까? – wanttogoshreddingeveryday

관련 문제