[
    {
        "choices": [
        ],
        "data_type": "string",
        "default_value": "Pending...",
        "description": "",
        "display_name": "BitLocker Key",
        "field_name": "bitlocker_key",
        "is_global": true,
        "metadata": {
            "macos": {
                "extension": "sh",
                "must_exit_zero": true,
                "replace_line_feed": true,
                "source": "#!/bin/bash\n#\n# FileWave client will execute this script. The output will be used as the value of the custom field.\n# \n# Below is an example of how to read the value of one ENVIRONMENT VARIABLE in your script:\n\n# my_var=${ENV_VAR_NAME}\n#\necho \"Not Applicable\"\nexit 0"
            },
            "windows": {
                "extension": "ps1",
                "must_exit_zero": true,
                "replace_line_feed": true,
                "source": "# FileWave client will execute this script. The output will be used as the value of the custom field.\n# \n# Below is an example of how to read the value of one ENVIRONMENT VARIABLE in your script:\n\n# $my_var = $Env:ENV_VAR_NAME\n# \n# Identify all the Bitlocker volumes.\n$BitlockerVolumers = Get-BitLockerVolume\n\n# For each volume, get the RecoveryPassowrd and display it.\n$BitlockerVolumers |\n    ForEach-Object {\n        $MountPoint = $_.MountPoint \n        $RecoveryKey = [string]($_.KeyProtector).RecoveryPassword       \n        if ($RecoveryKey.Length -gt 5) {\n            Write-Output (\"$MountPoint,$RecoveryKey\")\n        }        \n    }\n\nexit 0"
            }
        },
        "provider": 1,
        "to_be_deleted": false,
        "used_in_workflows": false
    }
]
