Skip to content

Instantly share code, notes, and snippets.

@SMSAgentSoftware
SMSAgentSoftware / Delete-DeviceRecords.ps1
Last active July 4, 2024 16:28
Deletes device records in AD / AAD / Intune / Autopilot / ConfigMgr. Useful for Autopilot test deployments.
[CmdletBinding(DefaultParameterSetName='All')]
Param
(
[Parameter(ParameterSetName='All',Mandatory=$true,ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$true)]
[Parameter(ParameterSetName='Individual',Mandatory=$true,ValueFromPipelineByPropertyName=$true,ValueFromPipeline=$true)]
[string[]]$ComputerName,
[Parameter(ParameterSetName='All')]
[switch]$All = $True,
[Parameter(ParameterSetName='Individual')]
[switch]$AD,
@DrEmpiricism
DrEmpiricism / Start-WindowsCleanup.ps1
Last active June 28, 2024 08:36
Clean-up system clutter and reclaim disk space
Function Start-WindowsCleanup
{
<#
.SYNOPSIS
`Start-WindowsCleanup` cleans-up a system clutter and reclaims disk space.
.DESCRIPTION
The `Start-WindowsCleanup` cmdlet performs the following clean-up tasks to reclaim disk space:
Clears the contents of common directories of the Windows file system for both the current running user and the global system that are used to store temporary, logging, backup, cache and dump files.