edk2toollib/windows/policy/firmware_policy.py
def SetDeviceTarget(self, target: dict):
        """ target should be a dictionary of ValueName/Value pairs """
        for k, v in target.items():
            ValueName = PolicyString(String=k)
            if k == "Nonce":
                policyVT = PolicyValueType(Type=PolicyValueType.POLICY_VALUE_TYPE_QWORD)
                Value = PolicyValue(valueType=policyVT, value=v)
            else:
                policyVT = PolicyValueType(Type=PolicyValueType.POLICY_VALUE_TYPE_STRING)
                Value = PolicyValue(valueType=policyVT, value=PolicyString(String=v))
            rule = Rule(RootKey=self.FW_POLICY_ROOT_KEY,
                        SubKeyName=PolicyString(String=self.FW_POLICY_SUB_KEY_NAME_TARGET),
                        ValueName=ValueName, Value=Value)
            self.AddRule(rule)
 target should be a dictionary of ValueName/Value pairs 
target should be a dictionary of ValueName/Value pairs
target should be a dictionary of ValueName / Value pairs
def SetDeviceTarget(self, target: dict):
        for k, v in target.items():
            ValueName = PolicyString(String=k)
            if k == "Nonce":
                policyVT = PolicyValueType(Type=PolicyValueType.POLICY_VALUE_TYPE_QWORD)
                Value = PolicyValue(valueType=policyVT, value=v)
            else:
                policyVT = PolicyValueType(Type=PolicyValueType.POLICY_VALUE_TYPE_STRING)
                Value = PolicyValue(valueType=policyVT, value=PolicyString(String=v))
            rule = Rule(RootKey=self.FW_POLICY_ROOT_KEY,
                        SubKeyName=PolicyString(String=self.FW_POLICY_SUB_KEY_NAME_TARGET),
                        ValueName=ValueName, Value=Value)
            self.AddRule(rule)
def SetDeviceTarget ( self , target : dict ) : for k , v in target . items ( ) : ValueName = PolicyString ( String = k ) if k == "Nonce" : policyVT = PolicyValueType ( Type = PolicyValueType . POLICY_VALUE_TYPE_QWORD ) Value = PolicyValue ( valueType = policyVT , value = v ) else : policyVT = PolicyValueType ( Type = PolicyValueType . POLICY_VALUE_TYPE_STRING ) Value = PolicyValue ( valueType = policyVT , value = PolicyString ( String = v ) ) rule = Rule ( RootKey = self . FW_POLICY_ROOT_KEY , SubKeyName = PolicyString ( String = self . FW_POLICY_SUB_KEY_NAME_TARGET ) , ValueName = ValueName , Value = Value ) self . AddRule ( rule )
target should be a dictionary of ValueName/Value pairs
target should be a dictionary of ValueName / Value pairs
""" target should be a dictionary of ValueName/Value pairs """
self
target
dict