Writing The YAML#

Remember all the .yml files you created before? Those are files written in YAML, the primary markup language that Playbooks are written in.

YAML is quite simple, so if you’ve never heard of it, no worries. Just follow the examples and you’ll get the hang of it in no time.

Prerequisites#

To edit YAML, you’ll need a text editor with proper syntax highlighting. Listed below are three good options to choose from.

Editing header file#

Start by opening Configuration\custom.yml with your installed text editor of choice, and pasting the following text inside:

title: Custom
tasks:
- Tasks\registry.yml
- Tasks\appx.yml

This file is our “header” file, which contains references to the other YAML files, which will sort of act as individual “scripts”.

Implementing actions#

Each file listed above (registry.yml & appx.yml) will contain a set of actions. These are operations for AME Wizard to perform, such as modifying the registry, deleting a file, and much more. Think of actions like commands, if you’re familiar with those.

Start by opening Configuration\Tasks\registry.yml with the same text editor as before, and paste the following text inside:

title: Registry Edits
actions:
    # Disable Windows Error Reporting
  - !registryValue: {path: 'HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting', value: 'Disabled', type:  REG_DWORD, data: '1'}

    # Show hidden files
  - !registryValue: {path: 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced', value: 'Hidden', type: REG_DWORD, data: '1'}

    # Remove Taskbar Task View button
  - !registryValue: {path: 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced', value: 'ShowTaskViewButton', type: REG_DWORD, data: '0'}

Likewise, for appx.yml:

title: APPX Removal
actions:
    # Remove Microsoft Store (APPX) apps
  - !appx: {name: '*disney*', type: family}
  - !appx: {name: '*PowerAutomate*', type: family}
  - !appx: {name: '*MicrosoftTeams*', type: family}

    # Necessary to refresh start menu entries etc.
  - !appx: {name: '*Client.CBS*', operation: clearCache}
  - !appx: {name: '*StartMenuExperienceHost*', operation: clearCache}
  - !appx: {name: '*Windows.Search*', operation: clearCache}

Make sure that you save each file before closing your editor.

Note

These are merely examples, so feel free to change them as you wish with whatever actions you’d like. Feel free to use an existing Playbook as inspiration.