def METHOD_NAME():
    client = MagicMock(spec=PowerShellClient)
    client.connected.return_value = False
    def set_connected(value: bool):
        client.connected.return_value = value
    client.connect.side_effect = lambda *_, **__: set_connected(True)
    return client