HTML report with Powershell Data

Welcome Forums General PowerShell Q&A HTML report with Powershell Data

This topic contains 2 replies, has 3 voices, and was last updated by

 
Keymaster
6 months, 2 weeks ago.

  • Author
    Posts
  • #113858

    Participant
    Topics: 1
    Replies: 0
    Points: 0
    Rank: Member

    Greetings,

    I would like to create html report with Powershell data. I have html code and powershell commands for my result. But I don't know to combine these two in one.
    Per example: I want
    HTML header is " Welcome to my page"
    body (Powershell commands like get-date, psversiontable, system information)
    
    HTML footer is "Please let us know your suggestions"
    
    Any Suggestions would be appreciated!
    
    
    Thank you in Advance :-)

    Please have look at my powershell script as below.

    $head = @"

    HTML Screen Saver

    Use the HTML refresh meta tag or a script to change pages

    Businesses, you could use it so that idle PCs display your intranet
    site, or even a PowerPoint presentation of your latest product

    Demo page 2

    "@

    Function Win-Win{

    # Site configuration
    $SiteCode = "*** # Site code
    $ProviderMachineName = "******" # SMS Provider machine name
    # Customizations
    $initParams = @{}
    #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging
    #$initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors

    # Do not change anything below this line

    # Import the ConfigurationManager.psd1 module
    if((Get-Module ConfigurationManager) -eq $null) {
    Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams
    }

    # Connect to the site's drive if it is not already present
    if((Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue) -eq $null) {
    New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName @initParams
    }

    # Set the current location to be the site code.
    Set-Location "$($SiteCode):\" @initParams
    $count = (get-cmdevice -collectionname "SPaCE Test Windows 10").count
    $Totalcount = "Total Number of Migrated Windows 10 Machines  " +  $count
    $Totalcount | Set-Content "C:\temp\Windows 10 Count.html"
    }

    # Call Function
    Win-Win

  • #113890

    Participant
    Topics: 2
    Replies: 876
    Points: 1,354
    Helping Hand
    Rank: Community Hero

    This is not a stand alone PS code issue, but a WebDev HTML style / format implementation. That being said. Take a look and this detailed article and the full example / with code provided there.

    Though you are after more items than the article covers, it should get you where you want to be.

    Creating Colorful HTML Disk Reports with PowerShell

  • #113953

    Keymaster
    Topics: 13
    Replies: 4872
    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    You can also read our free ebook on Creating HTML Reports in PowerShell.

The topic ‘HTML report with Powershell Data’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort