How to launch a powershell command via mqtt?

I tried to send a command through mqtt (start-process spotify) but the receiving end Hass Agent does nothing. What I’m trying to do is open a Microsoft app (spotify) which doesn’t have a normal installation exe. In terminal I can run the command, but mqtt doesn’t seem to do it.

Here’s the flow:

[
    {
        "id": "2ea56165d99081e7",
        "type": "server-state-changed",
        "z": "cb7f694f30c3378d",
        "name": "When Spotify Plus is Turned On",
        "server": "b3afb4a3.474b18",
        "version": 5,
        "outputs": 2,
        "exposeAsEntityConfig": "",
        "entityId": "media_player.spotifyplus_marco_emmanuel",
        "entityIdType": "exact",
        "outputInitially": false,
        "stateType": "str",
        "ifState": "on",
        "ifStateType": "str",
        "ifStateOperator": "is",
        "outputOnlyOnStateChange": true,
        "for": "0",
        "forType": "num",
        "forUnits": "minutes",
        "ignorePrevStateNull": false,
        "ignorePrevStateUnknown": false,
        "ignorePrevStateUnavailable": false,
        "ignoreCurrentStateUnknown": false,
        "ignoreCurrentStateUnavailable": true,
        "outputProperties": [
            {
                "property": "payload",
                "propertyType": "msg",
                "value": "",
                "valueType": "entityState"
            },
            {
                "property": "data",
                "propertyType": "msg",
                "value": "",
                "valueType": "eventData"
            },
            {
                "property": "topic",
                "propertyType": "msg",
                "value": "",
                "valueType": "triggerId"
            }
        ],
        "x": 170,
        "y": 780,
        "wires": [
            [
                "33a8fa0c07bce8cc"
            ],
            []
        ]
    },
    {
        "id": "33a8fa0c07bce8cc",
        "type": "change",
        "z": "cb7f694f30c3378d",
        "name": "Set Payload Launch Spotify PC",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "\"homeassistant/button/NerdBox/Launch_Windows_Program/action\"",
                "tot": "json"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "start-process spotify",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "qos",
                "pt": "msg",
                "to": "0",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "retain",
                "pt": "msg",
                "to": "false",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 470,
        "y": 780,
        "wires": [
            [
                "a9b7510f20d66b5d"
            ]
        ]
    },
    {
        "id": "a9b7510f20d66b5d",
        "type": "mqtt out",
        "z": "cb7f694f30c3378d",
        "name": "MQTT Publish",
        "topic": "",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "a9e2a0b33821f130",
        "x": 760,
        "y": 780,
        "wires": []
    },
    {
        "id": "b3afb4a3.474b18",
        "type": "server",
        "name": "Home Assistant",
        "addon": true,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|on|true|home|open",
        "connectionDelay": true,
        "cacheJson": true,
        "heartbeat": false,
        "heartbeatInterval": "25",
        "areaSelector": "friendlyName",
        "deviceSelector": "friendlyName",
        "entitySelector": "id",
        "statusSeparator": "",
        "statusYear": "hidden",
        "statusMonth": "hidden",
        "statusDay": "numeric",
        "statusHourCycle": "h12",
        "statusTimeFormat": "h:m",
        "enableGlobalContextStore": true
    },
    {
        "id": "a9e2a0b33821f130",
        "type": "mqtt-broker",
        "name": "mqtt",
        "broker": "localhost",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "5",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "homeassistant/status",
        "birthQos": "0",
        "birthRetain": "true",
        "birthPayload": "online",
        "birthMsg": {},
        "closeTopic": "homeassistant/status",
        "closeQos": "0",
        "closeRetain": "true",
        "closePayload": "offline",
        "closeMsg": {},
        "willTopic": "homeassistant/status",
        "willQos": "0",
        "willRetain": "true",
        "willPayload": "offline",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

If you go to dev tools/services and publish does ha respond? There is also an exec node that lets you run commands direct from nodered.

Edit: another option is to put the command in a ha script and call that from NR

Use MQTT explorer to determine if the MQTT commands are received on the server.
If it is then it is a question about the last part of the chain reaction to it, which sounds like a Hass agent issue then and should probably be dealt with in the GitHub page on that app.

yeah I screwed up, the HASS agent command was set to custom, and not powershell. Once I fixed it, the command ran.