<commit_before>﻿function Set-SCCMClientCacheLocation
{
    <#
        .SYNOPSIS
            Function to set the cache location on a SCCM Client
        .DESCRIPTION
            Function to set the cache location on a SCCM Client
        .PARAMETER ComputerName
            Specifies the name of the client on which the Cache location need to be changed
        .PARAMETER Location
            Specifies the location of the cache.
        .PARAMETER ServiceRestart
            Specifies that you want the SCCM Client service to restart
        .PARAMETER Credential
            Specifies the credential to use against the remote machine
            Only work with the WMI query for now, not the service restart
        .EXAMPLE
            Set-SCCMClientCacheLocation -ComputerName Client01 -Location "C:\temp\ccmcache"

            This will set the client cache location "C:\temp\ccmcache" on the computer Client01
    #>
    PARAM(
        [string[]]$ComputerName=".",

        [parameter(Mandatory)]
        [int]$Location,

        [Switch]$ServiceRestart,

        [Alias('RunAs')]
        [pscredential]
        [System.Management.Automation.Credential()]
        $Credential = [System.Management.Automation.PSCredential]::Empty
    )

    FOREACH ($Computer in $ComputerName)
    {
        Write-Verbose -message "[PROCESS] ComputerName: $Computer"

        # Define Parameters
        $SplattingWMI = @{
            NameSpace = "ROOT\CCM\SoftMgmtAgent"
            Class = "CacheConfig"
        }
        $SplattingService = @{
            Name = 'ccmexec'
        }

        IF ($PSBoundParameters['ComputerName'])
        {
            $SplattingWMI.ComputerName = $Computer
            $SplattingService.ComputerName = $Computer
        }
        IF ($PSBoundParameters['Credential'])
        {
            $SplattingWMI.Credential = $Credential
        }

        TRY
        {
            # Set the Cache Size
            $Cache = Get-WmiObject @SplattingWMI
            $Cache.location = $Location
            $Cache.Put()

            # Restart SCCM Client
            IF($PSBoundParameters['ServiceRestart'])
            {
                Get-Service @SplattingService | Restart-Service
            }
        }
        CATCH
        {
            $PSCmdlet.ThrowTerminatingError($_)
        }
    }
}<commit_msg>Update script format<commit_after>function Set-SCCMClientCacheLocation {
    <#
        .SYNOPSIS
            Function to set the cache location on a SCCM Client
        .DESCRIPTION
            Function to set the cache location on a SCCM Client
        .PARAMETER ComputerName
            Specifies the name of the client on which the Cache location need to be changed
        .PARAMETER Location
            Specifies the location of the cache.
        .PARAMETER ServiceRestart
            Specifies that you want the SCCM Client service to restart
        .PARAMETER Credential
            Specifies the credential to use against the remote machine
            Only work with the WMI query for now, not the service restart
        .EXAMPLE
            Set-SCCMClientCacheLocation -ComputerName Client01 -Location "C:\temp\ccmcache"

            This will set the client cache location "C:\temp\ccmcache" on the computer Client01
    #>
    PARAM(
        [string[]]$ComputerName = ".",

        [parameter(Mandatory)]
        [int]$Location,

        [Switch]$ServiceRestart,

        [Alias('RunAs')]
        [pscredential]
        [System.Management.Automation.Credential()]
        $Credential = [System.Management.Automation.PSCredential]::Empty
    )

    FOREACH ($Computer in $ComputerName) {
        Write-Verbose -message "[PROCESS] ComputerName: $Computer"

        # Define Parameters
        $SplattingWMI = @{
            NameSpace = "ROOT\CCM\SoftMgmtAgent"
            Class     = "CacheConfig"
        }
        $SplattingService = @{
            Name = 'ccmexec'
        }

        IF ($PSBoundParameters['ComputerName']) {
            $SplattingWMI.ComputerName = $Computer
            $SplattingService.ComputerName = $Computer
        }
        IF ($PSBoundParameters['Credential']) {
            $SplattingWMI.Credential = $Credential
        }

        TRY {
            # Set the Cache Size
            $Cache = Get-WmiObject @SplattingWMI
            $Cache.location = $Location
            $Cache.Put()

            # Restart SCCM Client
            IF ($PSBoundParameters['ServiceRestart']) {
                Get-Service @SplattingService | Restart-Service
            }
        }
        CATCH {
            $PSCmdlet.ThrowTerminatingError($_)
        }
    }
}
{'fraction_non_alphanumeric': 0.07898723220082234, 'fraction_numerical': 0.0017312270071413113, 'mean_word_length': 1.8251833740831296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '257073', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1201, 'n_words': 325}