< Back

Invoke-InfrastructureMaintenance

Sat Jan 11, 2020 3:46 am

NAME Invoke-InfrastructureMaintenance



SYNOPSIS

Use this function to invoke maintenance on all hosts defined in the hosts configuration file.





SYNTAX

Invoke-InfrastructureMaintenance [[-LogErrorFilePath] <String>] [[-LogFilePathTemplate] <String>] [[-LogMutexName]

<String>] [-DebugLog] [-FailOnPreviousFailure] [<CommonParameters>]





DESCRIPTION

The function performs maintenance on all hosts defined in the hosts configuration files, one by one. Its main

purpose is to be executed from Task Scheduler. We do not recommend to execute this function from an

orchestration/configuration management system (Ansible, Chef, System Center Orchestrator etc.) - use

Invoke-ComputerMaintenance for that.





PARAMETERS

-DebugLog [<SwitchParameter>]

Specifies if the function should log maintenance process in details through the debug log.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-LogErrorFilePath <String>

A path to the error log file.



Required? false

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LogFilePathTemplate <String>

A template used for debug log file paths.



Required? false

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LogMutexName <String>

The name of a mutex used to access a debug log file object.



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-FailOnPreviousFailure [<SwitchParameter>]

Defines if the maintenance process should not start when an error log exists.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None







OUTPUTS

System.Object







NOTES









-------------------------- Example 1 --------------------------



PS C:\\> Invoke-InfrastructureMaintenance



Performs maintenance tasks on all hosts defined in the main configuration file.

-------------------------- Example 2 --------------------------



PS C:\\> Invoke-InfrastructureMaintenance -DebugLog



Performs maintenance tasks on all hosts defined in the main configuration file, while logging every

command/variable into debug log files.



RELATED LINKS