def rule(event):
    if all(
        [
            any(
                [
                    "Remove-SmbShare" in event.deep_get("ScriptBlockText", default=""),
                    "Remove-FileShare" in event.deep_get("ScriptBlockText", default=""),
                ]
            ),
            not all(
                [
                    "FileShare.cdxml" in event.deep_get("ScriptBlockText", default=""),
                    "Microsoft.PowerShell.Core\\Export-ModuleMember"
                    in event.deep_get("ScriptBlockText", default=""),
                    "ROOT/Microsoft/Windows/Storage/MSFT_FileShare"
                    in event.deep_get("ScriptBlockText", default=""),
                    "ObjectModelWrapper" in event.deep_get("ScriptBlockText", default=""),
                    "Cmdletization.MethodParameter"
                    in event.deep_get("ScriptBlockText", default=""),
                ]
            ),
        ]
    ):
        return True
    return False
