I am new to powershell ,I wrote a simple function you can find below but ia m unable to excute that function.
Write-Output "Hello. Welcome to PowerShell Functions"
I have saved the file (.ps1) and then navigated to the path and excuted the function
PS C:\Tools> .\Sample.ps1 (I have also tried ..\Sample.ps1)
PS C:\Tools> sayhello
The term 'sayhello' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was in
cluded, verify that the path is correct and try again.
At line:1 char:9
+ sayhello <<<<
+ CategoryInfo : ObjectNotFound: (sayhello:String) , CommandNot
+ FullyQualifiedErrorId : CommandNotFoundException
Please help me out on this issue.I am sure I am missing something on execution.
View Complete Post