<commit_before>$apiKey = "Your API Token Here"
$URLResource = "https://serverURL/api/bit9platform/v1/fileRule"

$URLfileBan = $URLResource+"?q=fileState:3"

$FileBan = Invoke-RestMethod -Uri $URLfileBan -Method Get -Header @{ "X-Auth-Token" = $apiKey } 

foreach ( $ban in $FileBan )
{
    $ConsoleUsers = $ban.createdBy
    $RuleName = $ban.name
    switch ($ConsoleUsers) 
    { 
        "User1" { $TeamTag = "[Team1]" } 
        "User2" { $TeamTag = "[Team2]" } 
        "User3" { $TeamTag = "[Team3]" } 
        "User4" { $TeamTag = "[Team1]" } 
        "User5" { $TeamTag = "[Team1]" } 
        "System" { $TeamTag = "[System]" } 
        default {"Could not determine"}
    }
    if ( $RuleName -notmatch "$TeamTag*" ) 
        {
            $ban.name = $TeamTag + $RuleName
            $json = $ban | ConvertTo-Json
            $URLfileBan = $URLResource
            Invoke-RestMethod -Uri $URLfileBan -Method Post -Header @{ "X-Auth-Token" = $apiKey }  -Body $json -ContentType 'application/json'
        }
}<commit_msg>Update B9-RenameFileBans.ps1<commit_after>$apiKey = "Your API Token Here"
$URLResource = "https://serverURL/api/bit9platform/v1/fileRule"

$URLfileBan = $URLResource+"?q=fileState:3"

$FileBan = Invoke-RestMethod -Uri $URLfileBan -Method Get -Header @{ "X-Auth-Token" = $apiKey } 

foreach ( $ban in $FileBan )
{
    $ConsoleUsers = $ban.createdBy
    $RuleName = $ban.name
    switch ($ConsoleUsers) 
    { 
        "User1" { $TeamTag = "[Team1]" } 
        "User2" { $TeamTag = "[Team2]" } 
        "User3" { $TeamTag = "[Team3]" } 
        "User4" { $TeamTag = "[Team1]" } 
        "User5" { $TeamTag = "[Team1]" } 
        "System" { $TeamTag = "[System]" } 
        default {"Could not determine"}
    }
    if ( $RuleName -notmatch "$TeamTag*" ) 
        {
            $ban.name = $TeamTag + $RuleName
            $json = $ban | ConvertTo-Json
            Invoke-RestMethod -Uri $URLResource -Method Post -Header @{ "X-Auth-Token" = $apiKey }  -Body $json -ContentType 'application/json'
        }
}
{'fraction_non_alphanumeric': 0.16674864731923267, 'fraction_numerical': 0.013772749631087064, 'mean_word_length': 2.430016863406408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1077341', 'n_tokens_mistral': 741, 'n_tokens_neox': 693, 'n_words': 147}