You have to put it into ChromeOptions, which is part of the $sDesiredCapabilities string that is passed to _WD_CreateSession. I would suggest trying something like this -- $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"chromeOptions": {"w3c": true, "args": [--user-data-dir='&@ScriptDir&'\userdata]}}}}'