403Webshell
Server IP : 123.56.80.60  /  Your IP : 216.73.216.78
Web Server : Apache/2.4.54 (Win32) OpenSSL/1.1.1s PHP/7.4.33 mod_fcgid/2.3.10-dev
System : Windows NT iZhx3sob14hnz7Z 10.0 build 14393 (Windows Server 2016) i586
User : SYSTEM ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Windows/diagnostics/system/WindowsUpdate/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Windows/diagnostics/system/WindowsUpdate/utils_reporting.ps1
# Copyright © 2012, Microsoft Corporation. All rights reserved.

# Format-DiagReport
# Format-DiagChart
# Set-DiagPID
# StrArrayTo-ObjArray

function Format-DiagReport ([string]$Style, [System.Xml.XmlDocument]$xml)
{
	$xmlBase = $xml.PSBase
    $xmlNode = $xmlBase.SelectSingleNode("//Objects")
    [System.Xml.XmlAttribute]$attrib = $xmlBase.CreateAttribute("style")

    if ($style.length -gt 0)
    {
        switch ($Style)
        {
            "column" {
                $xmlNode.setattribute("style", "$style")
                
                $headerItems = @()
                
                $xmlNode.SelectNodes("//Property") | ForEach-Object {
                    if ($headeritems -contains $_.name) {
                    }
                    else
                    {
                        $headeritems += $_.name
                    }
                }
                
                $headerNode = $xmlBase.CreateElement("Header")
                
                $xmlNode.appendchild($headernode) > $null
                
                $headeritems | ForEach-Object {
                    $prop = $xmlBase.CreateElement("Property")
                    $prop.setattribute("Name", "$_")
                    $headerNode.appendchild($prop) > $null 
                }
            }
            
            "literal" { 
                $xmlnode.setattribute("style", "$style")
            }
            
            default {
                $xmlnode.setattribute("style", "unsupported")
            }
                    
        }
    }
    $xmlBase.outerxml
}

function Format-DiagChart ($object, $PropNameField, $PropValueField, $PropMaxValueField, $absolute, $Title, $style)
{
    $xmlStrings
    
    $minVal = 0
    $maxVal = 0
    
    #get min and max values
    if ($absolute -eq 1)
    {
        for ($i = 0; $i -lt $object.length; $i++)
        {
            if ($object[$i]."$PropMaxValueField" -gt $maxVal)
            {
                $maxVal = $object[$i]."$PropMaxValueField"
            }
            if ($object[$I]."$PropMaxValueField" -lt $minVal)
            {
                $minVal = $object[$i]."$PropMaxValueField"
            }
        }
    }

    #Add each item to chart
    for ($i = 0; $i -lt $object.length; $i++)
    {
        if ($absolute -ne 1)
        {
            $maxval = 0
            $minval = 0
            
            if ($object[$i]."$PropMaxValueField" -gt $maxVal)
            {
                $maxVal = $object[$i]."$PropMaxValueField"
            }
            if ($object[$I]."$PropMaxValueField" -lt $minVal)
            {
                $minVal = $object[$i]."$PropMaxValueField"
            }
        }
        $itemSize = [math]::round(($object[$i]."$PropValueField" / $maxval) * 100,1)
        if ($itemSize -le 0)
        {
            $itemSize = 0
        }
        $itemValue = $object[$i]."$PropValueField"
        
        $itemName = $object[$i]."$PropNameField"
        $xmlStrings = $xmlStrings + "<Property Name='$itemName' Size='$itemSize' Label='$itemValue'/>"
    }
    
    $xmlstrings = $xmlstrings.insert(0, "<Objects style='$style'><Object Name='$Title'>")
    $xmlstrings = $xmlstrings + "</Object></Objects>"
    
    $xmlstrings
    
}

# Place ProductID in Debug Report
function Set-DiagPID([string]$ProductName, [string]$ProductID)
{
	$PIDObject = "" | Select-Object ProductName						# Return object
	$PIDObject.ProductName = $ProductName
	
	add-member -inputobject $PIDObject -membertype noteproperty -name ProductID -value $ProductID
	
	(convertto-xml -InputObject $PIDObject) | update-diagreport -id OAS_DATAPOINT_ID -name "OAS_DATAPOINT" -description "OAS Data Point for OAS submission" -verbosity debug
}

function StrArrayTo-ObjArray([Array]$strArray, [string]$PropertyName='Name')
{
	$Output = @() 
	
	foreach($item in $strArray)
	{
		$TableEntry = New-Object psobject
		Add-Member -inputobject $TableEntry  -membertype NoteProperty -Name $PropertyName -Value $item
		$Output += $TableEntry
	}
	
	return $Output
}

Youez - 2016 - github.com/yon3zu
LinuXploit