Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

call a ps1 script within a script and email the results

$
0
0

hi all

im trying to tweak a pretty simple powershell script that calls on another powershell script and then emails the results... the script gathers datastore information and calculates the percentage free.
but im having issues where its spitting out a error that says

Send-MailMessage : A positional parameter cannot be found that accepts argument 'C:\Scripts\PowerCLI\VMFS_unmap\percentfree.ps1'.

At C:\Scripts\PowerCLI\VMFS_unmap\VMware_measurecommand_plink_test.ps1:17 char:17
+ Send-MailMessage <<<< -From "VMFS_unmap " -To "me" -Subject "VMFS unmap confirmation - Completed" -Body $body $percentfree-SmtpServer smtpserver

+ CategoryInfo : InvalidArgument: (:) [Send-MailMessage], ParameterBindingException+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SendMailMessage

script looks like this

$body = Measure-Command {C:\Scripts\...

<<<< -From "VMFS_unmap

Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

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