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

# 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

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

Enable-SPInfoPathFormTemplate -Identity $FormName -Site $SiteCollection

net start SPAdminV4
  • 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). – BlueSoul Dec 17 '12 at 12:14

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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