Closed Bug 1504971 Opened 7 years ago Closed 7 years ago

refactor rundsc.ps1 so that all processing happens inside a function

Categories

(Infrastructure & Operations :: RelOps: OpenCloudConfig, task)

Unspecified
Windows
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: grenade, Assigned: grenade)

Details

Attachments

(1 file)

occ's rundsc.ps1 contains a fair amount of logic and decision trees that are not correctly logged in papertrail. refactor the script so that all processing occurs inside of a function that includes appropriately verbose logging for the logic being processed. all functions should take the form below so that we also collect processing time metrics for everything the script does: function Verb-SomeFunction { param ( ... ) begin { Write-Log -message ('{0} :: begin - {1:o}' -f $($MyInvocation.MyCommand.Name), (Get-Date).ToUniversalTime()) -severity 'DEBUG' } process { ... } end { Write-Log -message ('{0} :: end - {1:o}' -f $($MyInvocation.MyCommand.Name), (Get-Date).ToUniversalTime()) -severity 'DEBUG' } }
Attached file GitHub Pull Request
added functions for: - Set-ServiceState - Set-DomainName - Set-DynamicDnsRegistration - Run-MaintainSystem - Run-RemoteDesiredStateConfig - Set-ComputerName wrapped everything else in: - Run-OpenCloudConfig this last mega function still needs a lot of refactoring into smaller methods.
Assignee: nobody → rthijssen
Status: NEW → ASSIGNED
Attachment #9022948 - Flags: review?(mcornmesser)
Attachment #9022948 - Flags: review?(mcornmesser) → review+
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: