Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Run Function - command line

$
0
0

Hi Chaps.Sorry for a bit of a noob question but actually not done this before.

I am producing a backup / restore script for our helpdesk team. I was looking to have one script rather than two and then depending on what they wanted to do just call the function.

something like C:\ScriptName.ps1 Get-Backup

What do i need to do in order to achieve this? Many thanks

Function Get-Backup
{
MD -Force $HomeDrive\$BackupRoot

}

Function Get-Restore
{

write-host "blah blah blah"

}


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>