How can I resuse powershell functions in remote block to re-use them?
Example:- I have 3 functions that i need to run remotely like
function write-something($param1,$param2)
{
//Do Stuff
}
function Check-Application($param1)
{
//Do Stuff
}
function Create-Application()
{
//Do Stuff
Check-Application $param1
//Do Stuff
Write-Something $param1 $param2
}
write-something $param1 $param2
Invoke-Command -computer FQDN -scriptBlock <3functionsAbove> -arguments
write-something $param1 $param2
I'm also using write-something($param1,$param2) function locally. i want to define the write-something($param1,$param2) once and use locally and in remote process. Is there any way i can achieve this?