i have 5 functions copy-files, compare-files, alert-users, zip-files and remove-files.
they look like this:
function copy-file {
param ($a,$b)
copy-item $a $b
}
how do I create 1 script, that will go through the entire functionslist one after the other?
You define functions in first place and then you call them
Or I missed your point in question?
Hey Sanjaya,
You’d want to do something like this
Param(
[string]$a,
[string]$b
)
function copy-file
{
param ($a,$b)
Copy-Item $a $b
}
#put your functions here e.g.
function functionname
{
param ($a,$b)
command $a $b
}
.
.
.
#put your other commands here including the parameters, like :
copy-file -a $a -b $b