Someone expressed his needs to have a PowerShell script to create FormLibrary. Hence I have written the below script and it works in both SharePoint 2007 and SharePoint 2010. This code can be further modified to create other types of libraries as well.

I am sharing my code here:
function GetHelp() {            
$HelpText = @"
This script will create a form library.
function RahulFormLibraryCreation() {             
    write-host "This script will create a form library for you"            
    write-host "Please enter your site url"            
    $siteURL = read-host            
    write-host "Please enter name of the form library"            
    $library = read-host            
    write-host "Please enter description of your form library"            
    $desctiption = read-host            
    $site = New-Object Microsoft.SharePoint.SPSite($siteURL)            
    $web = $site.OpenWeb()            
    $template = [Microsoft.Sharepoint.SPListTemplateType]::XMLForm            
if($help) { GetHelp; Continue }            
else { RahulFormLibraryCreation }

Other Languages

This article is also available in the following languages: