Enhanced Scripts

The follow sub-menu pages contain live running PowerShell scripts that have been enhanced to support ATPowerForm's web rendering ability. Since these script are running in a shared hosting environment normal administrative PowerShell functions will not be presented (this can be done via the Trial download, all sample are included with the product).

PowerShell - Enhanced Script

With little enhancement a Native Script can be transformed into a a graphical web rendition.



Server:
 NameDisplayNameStatus
AeLookupSvcApplication ExperienceRunning
AESTFiltersAndrea ST Filters ServiceStopped
ALGApplication Layer Gateway ServiceStopped
AppHostSvcApplication Host Helper ServiceRunning
AppIDSvcApplication IdentityStopped
AppinfoApplication InformationStopped
Apple Mobile DeviceApple Mobile DeviceRunning
AppMgmtApplication ManagementStopped
aspnet_stateASP.NET State ServiceStopped
AudioEndpointBuilderWindows Audio Endpoint BuilderRunning
12345678910...
Total: 194

<#
.SYNOPSIS
    Tutorial - Services - Step 2
.DESCRIPTION
    The following script displays a list of services
.NOTES
    Script Name:        External_PS_Script_Demo.ps1
    Version:            1.0
      Author:           NuDigital Solutions
      Creation Date:    05/01/2014
#>
param(
    [string]$pfCMD = "",
    [int]$pfField,
    [hashtable]$pfFields = @{},
    [hashtable]$pfDetails = @{},
    [hashtable]$pfGlobals = @{},
    [string]$pfModPath = $Env:ATPowerForm,
    [string]$ServerName = ""
)

# Execute cmdlet to get services
if ($ServerName -ne "") {
    $Result = get-service -ComputerName $ServerName | select-object Name,DisplayName,Status
} Else {
    $Result = get-service | select-object Name,DisplayName,Status
}


################################
# Load ATPowerForm Interfaces
$pfScriptPath = $MyInvocation.MyCommand.Path;
. $pfModPath\ATPowerForm.ps1;
################################

<#
.SYNOPSIS
    Optional method to create ATPowerForm control definitions for rendoring in the UI 
#>
function pfPaint
{
    # Assign date to web gridview
    $dat = $Result | pfToTable -TableName "Services"
    pfGridView -Field 30 -BR 3 -DBListTable $dat -Caption $("Server: " + $ServerName)
}

#########################
# Main Execution and Exit
#########################
if ($pfCMD -ne "") {
    #pfTrace -Style Parameter -Type Inbound;
    $pfSuccess = pfExecute; # ATPowerForm Execution function
    Return $pfReturnData;
}

#########################
# Execution Non-ATPowerForm
#########################
Write-Output $Result