Hi Vagharsh,
I've taken the liberty to rewrite some of your function.
Noteable Changes:
- Removed the Project query. Instead, create a dedicated Get-Project function.
- Renamed all function calls to conform with PowerShell naming convention
- Added a husk for function help. Fill it with content, users can then use Get-Help on the function to ... get help :)
Further, please note that your parameter names should better denote what they are used for (File, File1 and File2 are hard to distinguish).
function Select-Project
{
<#
.SYNOPSIS
A brief description of the Select-Project function.
.DESCRIPTION
A detailed description of the Select-Project function.
.PARAMETER File
A description of the File parameter.
.PARAMETER File1
A description of the File1 parameter.
.PARAMETER File2
A description of the File2 parameter.
.PARAMETER Project
A description of the Project parameter.
.EXAMPLE
PS C:\> Select-Project -File $value1 -File1 $value2
.NOTES
Add some notes
.LINK
Link to online help.
#>
[CmdletBinding()]
Param (
[Parameter(Position = 0)]
$File,
[Parameter(Position = 1)]
$File1,
[Parameter(Position = 2)]
$File2,
[Parameter(ValueFromPipeline = $true)]
$Project
)
Process
{
foreach ($proj in $Project)
{
if (-not (Validate-Project $proj))
{
throw "Invalid project!"
}
Process-Project $proj
$something = Import-Clixml $File
$something | % {
Select-ProjectDirectory $_ 'src'
Select-ProjectDirectory $_ 'dst'
}
Prepare-AppNames $File1 'src'
Prepare-AppNames $File2 'dst'
}
}
}
Cheers,
Fred