janhoedt
asked on
Add function in Powershell
Hi,
I'm new to Powershell, I do know my way around but the basics only.
I found a function which I like to implement.
How do I do this (where do I copy this function and how do I call for it)?
Please advise.
J.
I'm new to Powershell, I do know my way around but the basics only.
I found a function which I like to implement.
How do I do this (where do I copy this function and how do I call for it)?
Please advise.
J.
ASKER
No, not clear at all.
ASKER
I have added the function but then what? If I call for the function I get errors "the term -myscript.ps1" is not recognized as the name of a cmdlet, function, script file ...
ASKER
I had to add an extra . before the ps1.
My path is that long so I did not use c:\... just the .\myscript.ps1 that doesnt work unless you add an extra .
My path is that long so I did not use c:\... just the .\myscript.ps1 that doesnt work unless you add an extra .
ASKER
So that is . .\Myscript.ps1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
PS : There is a space after dot.You can refer the following article for other examples..
http://blogs.technet.com/b/heyscriptingguy/archive/2010/08/10/how-to-reuse-windows-powershell-functions-in-scripts.aspx