sync
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
$Month = 7
|
||||
26..26 | ForEach-Object {
|
||||
$Records = [System.Collections.ArrayList]@()
|
||||
Write-Warning $_
|
||||
|
||||
$StartDate = Get-Date -Year 2023 -Month $Month -Day $_ -Hour 0 -Minute 0 -Second 0
|
||||
$EndDate = Get-Date -Year 2023 -Month $Month -Day $_ -Hour 23 -Minute 59 -Second 59
|
||||
|
||||
$filter = @('cat_item', '-eq', '89efc7041bb41dd04d8943b1b24bcb63'),
|
||||
'-and',
|
||||
@('opened_at', '-gt', $StartDate ),
|
||||
'-and',
|
||||
@('opened_at', '-lt', $EndDate )
|
||||
|
||||
$x = Get-ServiceNowRecord -Table 'Requested Item' -Filter $Filter -IncludeTotalCount -IncludeCustomVariable
|
||||
|
||||
ForEach ($z in $x) {
|
||||
$obj = [PSCustomObject]@{
|
||||
'number' = $z.number;
|
||||
'sys_id' = $z.sys_id;
|
||||
'opened_at' = $z.opened_at;
|
||||
'requested_for' = $z.requested_for.display_value;
|
||||
'request_type' = ($z.CustomVariable | Where-Object Name -EQ 'request_type').Value
|
||||
'application_name' = ($z.CustomVariable | Where-Object Name -EQ 'application_name').Value
|
||||
'environment' = ($z.CustomVariable | Where-Object Name -EQ 'environment').Value
|
||||
'additional_comments' = ($z.CustomVariable | Where-Object Name -EQ 'additional_comments').Value
|
||||
'vm_work_needed' = ($z.CustomVariable | Where-Object Name -EQ 'vm_work_needed').Value
|
||||
'server_name' = ($z.CustomVariable | Where-Object Name -EQ 'server_name').Value
|
||||
'host_name' = ($z.CustomVariable | Where-Object Name -EQ 'host_name').Value
|
||||
'server_type' = ($z.CustomVariable | Where-Object Name -EQ 'server_type').Value
|
||||
'operating_system' = ($z.CustomVariable | Where-Object Name -EQ 'operating_system').Value
|
||||
'target_platform' = ($z.CustomVariable | Where-Object Name -EQ 'target_platform').Value
|
||||
'processors' = ($z.CustomVariable | Where-Object Name -EQ 'processors').Value
|
||||
'memory_gb' = ($z.CustomVariable | Where-Object Name -EQ 'memory_gb').Value
|
||||
'cidr_block' = ($z.CustomVariable | Where-Object Name -EQ 'cidr_block').Value
|
||||
'data_center' = ($z.CustomVariable | Where-Object Name -EQ 'data_center').Value
|
||||
'licensing_restrictions' = ($z.CustomVariable | Where-Object Name -EQ 'licensing_restrictions').Value
|
||||
'agency_name' = ($z.CustomVariable | Where-Object Name -EQ 'agency_name').Value
|
||||
'application_info' = ($z.CustomVariable | Where-Object Name -EQ 'application_info').Value
|
||||
'support_hours' = ($z.CustomVariable | Where-Object Name -EQ 'support_hours').Value
|
||||
'dr_protection' = ($z.CustomVariable | Where-Object Name -EQ 'dr_protection').Value
|
||||
'startup_priority' = ($z.CustomVariable | Where-Object Name -EQ 'startup_priority').Value
|
||||
'disk_1_os' = ($z.CustomVariable | Where-Object Name -EQ 'disk_1_os').Value
|
||||
'disk_2_swap_disk' = ($z.CustomVariable | Where-Object Name -EQ 'disk_2_swap_disk').Value
|
||||
'disk_3' = ($z.CustomVariable | Where-Object Name -EQ 'disk_3').Value
|
||||
'disk_4' = ($z.CustomVariable | Where-Object Name -EQ 'disk_4').Value
|
||||
'disk_5' = ($z.CustomVariable | Where-Object Name -EQ 'disk_5').Value
|
||||
'disk_6' = ($z.CustomVariable | Where-Object Name -EQ 'disk_6').Value
|
||||
'disk_7' = ($z.CustomVariable | Where-Object Name -EQ 'disk_7').Value
|
||||
'disk_8' = ($z.CustomVariable | Where-Object Name -EQ 'disk_8').Value
|
||||
'disk_9' = ($z.CustomVariable | Where-Object Name -EQ 'disk_9').Value
|
||||
'disk_10' = ($z.CustomVariable | Where-Object Name -EQ 'disk_10').Value
|
||||
'disk_11' = ($z.CustomVariable | Where-Object Name -EQ 'disk_11').Value
|
||||
'disk_12' = ($z.CustomVariable | Where-Object Name -EQ 'disk_12').Value
|
||||
'disk_13' = ($z.CustomVariable | Where-Object Name -EQ 'disk_13').Value
|
||||
'disk_14' = ($z.CustomVariable | Where-Object Name -EQ 'disk_14').Value
|
||||
'disk_15' = ($z.CustomVariable | Where-Object Name -EQ 'disk_15').Value
|
||||
'disk_16' = ($z.CustomVariable | Where-Object Name -EQ 'disk_16').Value
|
||||
}
|
||||
$null = $Records.Add($obj)
|
||||
}
|
||||
|
||||
#$Records = $Records
|
||||
If ($Records) { $Records | Export-Csv "D:\OneDrive - State of North Dakota\RITMexport.csv" -Append -NoTypeInformation }
|
||||
}
|
||||
Reference in New Issue
Block a user