I want to pass an empty string as a variable value from ansible-playbook to PowerShell file.
Ansible Code:
vars:
name: {{file_name}}
tasks:
- name: run ps1
win_shell: "script.ps1 -database_name {{ name }}"
no_log: false
Powershell code
param(
[Parameter(Mandatory = $true)][AllowEmptyString()][string]$database_name
)
So if there is no name in file_name then I want to send an empty string to PowerShell file! How can I do that?