Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I deploy Infopath forms using powershell script. After deployment, dlls of my deployed application appears in 14 hives/feature/guidfeaturefolder After some modifications when i deploy again the same form, sometimes it creates a folder inside that guidfeaturefolder and then copies the dll to that folder and sometimes it will replace the existing dlls. Any one know how it happens?

Powershell script is as below

# Initializing variables
Write-Output "Initializing Varialbes"

$SiteCollection = "http://<Computer Name>/"
$FormName = "xsn name"
$FormPath = "xsn location"

# Disabling Form Template
Write-Output "Desabling Form Template"

Disable-SPInfoPathFormTemplate -Identity $FormName -Site $SiteCollection

# Unistalling Form template 
Write-Output "Uninstalling form Template"

Uninstall-SPInfoPathFormTemplate -Identity $FormName
net stop SPAdminV4
Start-SPAdminJob

# Verifying Form Template
Write-Output "Verifying form template"

Test-SPInfoPathFormTemplate -Path $FormPath

# Installing form template
Write-Output "Installing Form Template"

Install-SPInfoPathFormTemplate -Path $FormPath -NoWait
net stop SPAdminV4
Start-SPAdminJob

# Activating form template
Write-Output "Activating Form Template"

Enable-SPInfoPathFormTemplate -Identity $FormName -Site $SiteCollection

net start SPAdminV4
share|improve this question
    
Hi. I have taken the liberty to re-format your code sample. You can use this formatting by leaving four white space before any row of code you write. For other detail have a look at this. A formatted code is more readable and thus will attract more readers (and potential answerer). –  SPArchaeologist Dec 17 '12 at 12:14
add comment

1 Answer 1

This looks like a context issue, but I'm not 100%

The powershell context issue in a nutshell:

Powershell runs in a caches context, after installing or uninstalling a component you always need to restart the powershell command window to reload the owsvrdll and any custom DLLs.

The different you are seeing is most likely caused by you sometimes closing and sometimes not closing the powershell window.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.