Refactor taxonomy term parsing and remove redundant code in migration script
This commit is contained in:
@@ -1942,11 +1942,8 @@ function Convert-ToTaxonomyTermEntries {
|
|||||||
$label = $matches[1]
|
$label = $matches[1]
|
||||||
$termGuid = $matches[2]
|
$termGuid = $matches[2]
|
||||||
}
|
}
|
||||||
else {
|
elseif ([guid]::TryParse($rawTermString, [ref]([guid]::Empty))) {
|
||||||
$parsedGuid = [Guid]::Empty
|
$termGuid = $rawTermString
|
||||||
if ([guid]::TryParse($rawTermString, [ref]$parsedGuid)) {
|
|
||||||
$termGuid = $rawTermString
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2187,14 +2184,6 @@ function Set-SPItemFieldValue {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
switch ($field.TypeAsString) {
|
switch ($field.TypeAsString) {
|
||||||
"TaxonomyFieldType" {
|
|
||||||
Set-SPTaxonomyFieldValue -Item $Item -Field $field -RawValue $RawValue -TextValue $TextValue
|
|
||||||
return
|
|
||||||
}
|
|
||||||
"TaxonomyFieldTypeMulti" {
|
|
||||||
Set-SPTaxonomyFieldValue -Item $Item -Field $field -RawValue $RawValue -TextValue $TextValue
|
|
||||||
return
|
|
||||||
}
|
|
||||||
"Boolean" {
|
"Boolean" {
|
||||||
$Item[$field.InternalName] = Convert-ToBoolean -RawValue $RawValue -TextValue $TextValue
|
$Item[$field.InternalName] = Convert-ToBoolean -RawValue $RawValue -TextValue $TextValue
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user