none
send powershell output to a website RRS feed

  • Question

  • Hello all,

    I would like to send my script output to a website. This is what i'm doing

    $Output = (Get-Content HyperV-VM-Report.html |Out-String)
    $StartTime = Get-Date -Format yyyy-MM-dd_HHmmss
    $ScriptName = "Chekpoints"
    $Cluster = "clster1"
    $LogFileForQG = "\REPORT_"+$Cluster +"_"+$ScriptName+"_"+$StartTime+"$output.html"
    $DestinationUNCPath = "\\serverweb\E$\inetpub\wwwroot\PROD\Reports"

    But it seems not working. iI will appreciate your help.

    Thank you in advance

    Monday, March 19, 2018 4:05 PM

Answers

  • Move-Item -Path $LogFileForQG -Destination $DestinationUNCPath

    This should move the HTML file to the specified share for it to be added to IIS.

    Please use this link to learn how to create an IIS site using PowerShell. Let us know how you get on :)


    Learn PowerShell

    Script Requests

    -Remember to mark the correct response as the answer-

    Tuesday, March 20, 2018 9:38 AM
  • i did a

    Copy-Item $ResultFile "$DestinationUNCPath$LogFileForQG" -Force | Out-Null

    it works also.

    thank you anyway.

    Tuesday, March 20, 2018 10:14 AM

All replies

  • I don't understand what you mean. What is your script doing? so far it's just collecting variables.

    Are you trying to open the hyperv-vm-report.html in a browser window?


    Learn PowerShell

    Script Requests

    -Remember to mark the correct response as the answer-


    Monday, March 19, 2018 4:45 PM
  • Hi,

    I'm trying to send the output of a script that is in html to the intranet.

    I would like to have a daily log available on the intranet for the other worker. But i don't know how to do that.

    Thank you.

    Monday, March 19, 2018 5:19 PM
  • Move-Item -Path $LogFileForQG -Destination $DestinationUNCPath

    This should move the HTML file to the specified share for it to be added to IIS.

    Please use this link to learn how to create an IIS site using PowerShell. Let us know how you get on :)


    Learn PowerShell

    Script Requests

    -Remember to mark the correct response as the answer-

    Tuesday, March 20, 2018 9:38 AM
  • i did a

    Copy-Item $ResultFile "$DestinationUNCPath$LogFileForQG" -Force | Out-Null

    it works also.

    thank you anyway.

    Tuesday, March 20, 2018 10:14 AM