def rule(event):
    if all(
        [
            event.deep_get("Image", default="").endswith("\\link.exe"),
            "LINK /" in event.deep_get("CommandLine", default=""),
            not all(
                [
                    any(
                        [
                            event.deep_get("ParentImage", default="").startswith(
                                "C:\\Program Files\\Microsoft Visual Studio\\"
                            ),
                            event.deep_get("ParentImage", default="").startswith(
                                "C:\\Program Files (x86)\\Microsoft Visual Studio\\"
                            ),
                        ]
                    ),
                    any(
                        [
                            "\\VC\\bin\\" in event.deep_get("ParentImage", default=""),
                            "\\VC\\Tools\\" in event.deep_get("ParentImage", default=""),
                        ]
                    ),
                ]
            ),
        ]
    ):
        return True
    return False
