windows-admins / ConfigMgr

GNU General Public License v3.0
225 stars 57 forks source link

New-CMMaintenanceWindow.ps1 #78

Closed Ebag333 closed 3 years ago

Ebag333 commented 5 years ago
Line: 190 Function   'New-CMMaintenanceWindow' has verb that could change system state. Therefore,   the function has to support 'ShouldProcess'.
Line: 165 The cmdlet   'Convert-NormalDateToConfigMgrDate' returns an object of type 'System.String'   but this type is not declared in the OutputType attribute.
Line: 168 The cmdlet   'create-ScheduleToken' uses an unapproved verb.
Line: 203 File   'New-CMMaintenanceWindow.ps1' uses WMI cmdlet. For PowerShell 3.0 and above,   use CIM cmdlet which perform the same tasks as the WMI cmdlets. The CIM   cmdlets comply with WS-Management (WSMan) standards and with the Common   Information Model (CIM) standard, which enables the cmdlets to use the same   techniques to manage Windows computers and those running other operating   systems.
Line: 209 The variable 'disposable' is   assigned but never used.

https://dille.name/blog/2017/08/27/how-to-use-shouldprocess-in-powershell-functions/

Calling @TeslaSysA since this is your terrible workaround. 🤔