How can i execute a powershell function directly in a powershell command prompt as follow
>>PS C:\Users\tijo.scaria> Function Test-Demo
>> {
>> Param ($Param1)
>> Begin{ write-host "Starting"}
>> Process{ write-host "processing" $_ for $Param1}
>> End{write-host "Ending"}
>> }
How can i call this function. i tied by pressing CNTRL+C and get out of the function and tried following command
>>PS C:\Users\tijo.scaria> Echo Testing1, Testing2 | Test-Demo Sample
but i got the following error
Test-Demo : The term 'Test-Demo' is not recognized as the name of a cmdlet, function, script file, or operableprogram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.At line:1 char:27+ Echo Testing1, Testing2 |Test-Demo Sample
How can i execute a function directly from Command window