Question: Run powershell Script without parameter from commnadline argumnet then should call default custom function HelpList()

```
function HelpList() 
{  
   Write-Host "Calling HelpList function"   
} #end Help  

function clean()
{
    Write-Host "Cleaning solution"
}

```

Calling from Command line

`DepolymentScript.ps1 HelpList`
 Calling HelpList Function

DepolymentScript.ps1 Clean
 cleaning solution

DepolymentScript.ps1 

then getting blank. Here I need to display Calling HelpList Function

Answer: 
There are several ways to accomplish this. This way is a bit old school but it works:

```
param(
    $scriptParameter1 = '',
    $scriptParameter2 = ''
)

function HelpList{
    Write-Host "DevelopmentBuild.ps1 command line examples:"
}
if($scriptParameter1 -eq '' -OR $scriptParameter2 -eq ''){
    HelpList
}

```

Reading your comments I think you may want something different than what I thought. This may be more to your liking:

```
param(
    $scriptParameter1 = ''
)

function HelpList{
    Write-Host "DevelopmentBuild.ps1 command line examples:"
}
function Clean{
    #Do whatever clean does
}
switch $scriptParameter1{
    Clean {Clean}
    default {HelpList}
}

```
Calling functions can get quiet tricky

**Question:**  

Calling deploymentScript.ps1 with or without HelpList() should Display: **"Calling HelpList function**"

Calling deploymentScript.ps1 with Clean() should Display: **"Cleaning solution**

```
    function HelpList() 
{  
   Write-Host "Calling HelpList function"   
} #end Help  

function clean()
{
    Write-Host "Cleaning solution"
}

```

DepolymentScript.ps1 HelpList // Not sure how this would result in Calling HelpList Function from the console 

=================================================================
SOLUTION:

**Approach 1: TESTED AND RUN**

Alternate approach that you could use is to keep the .PS as it is 
and the below arguments to the command line 

`. C:\PowerShell_Scripts\deployment_script.ps1`

`dir function:\*`

Now you will be able to directly call functions by just their names

**Approach 2: TESTED and RUN**

```
 param(
    $param1 = ''
)

function HelpList{
    Write-Host "DevelopmentBuild.ps1 command line examples1:"
}
function Clean{
     Write-Host "Cleaning Solution"
}
if($param1 -eq '' -OR $param1 -eq 'HelpList')
{
    HelpList
}
if($param1 -eq 'Clean'){
    Clean
}

```

=======================================================================
[![enter image description here](https://i.stack.imgur.com/G0gLD.png)](https://i.stack.imgur.com/G0gLD.png)