Skip to main content
added 217 characters in body
Source Link
ckhanna
  • 3.7k
  • 1
  • 1
  • 12

You can use Get-ItemField function to get all item fields and loop through them as below to read them.

$item = Get-Item -Path "master:" -ID "{{Item_ID}}"
$fields = $item | Get-ItemField -ReturnType Field
foreach($field in $fields){
  Write-Host "Field Name: $($field.Name)"
  Write-Host "Field Value: $($item.Fields[$field.Name].Value)" 
}

This will return all the fields on the item which are not standard fields. In case you would like to fetch standard fields as well you can add -IncludeStandardFields flag to Get-ItemField function.

Note: In ordercase you need to make sureuse $item.Fields returnsto return all the fields, you will need to call $item.Fields.ReadAll() function before reading item fields as below.

$item.Fields.ReadAll()
# exclude standard fields.
$fields = $item.Fields | Where-Object { $_.Name -notlike '__**' }

We need to call ReadAll() function as above since Fields are lazy loaded, hence the call to this function is required to read all the fields.

Hope this helps!!!

You can use Get-ItemField function to get all item fields and loop through them as below to read them.

$item = Get-Item -Path "master:" -ID "{{Item_ID}}"
$fields = $item | Get-ItemField -ReturnType Field
foreach($field in $fields){
  Write-Host "Field Name: $($field.Name)"
  Write-Host "Field Value: $($item.Fields[$field.Name].Value)" 
}

This will return all the fields on the item which are not standard fields. In case you would like to fetch standard fields as well you can add -IncludeStandardFields flag to Get-ItemField function.

Note: In order to make sure $item.Fields returns all the fields, you will need to call $item.Fields.ReadAll() function before reading item fields as below.

$item.Fields.ReadAll()
# exclude standard fields.
$fields = $item.Fields | Where-Object { $_.Name -notlike '__**' }

We need to call ReadAll() function as above since Fields are lazy loaded, hence the call to this function is required to read all the fields.

Hope this helps!!!

You can use Get-ItemField function to get all item fields and loop through them as below to read them.

$item = Get-Item -Path "master:" -ID "{{Item_ID}}"
$fields = $item | Get-ItemField -ReturnType Field
foreach($field in $fields){
  Write-Host "Field Name: $($field.Name)"
  Write-Host "Field Value: $($item.Fields[$field.Name].Value)" 
}

This will return all the fields on the item which are not standard fields. In case you would like to fetch standard fields as well you can add -IncludeStandardFields flag to Get-ItemField function.

Note: In case you need to use $item.Fieldsto return all the fields, you will need to call $item.Fields.ReadAll() function before reading item fields as below.

$item.Fields.ReadAll()
# exclude standard fields.
$fields = $item.Fields | Where-Object { $_.Name -notlike '__**' }

We need to call ReadAll() function as above since Fields are lazy loaded, hence the call to this function is required to read all the fields.

Hope this helps!!!

added 217 characters in body
Source Link
ckhanna
  • 3.7k
  • 1
  • 1
  • 12

You can use Get-ItemField function to get all item fields and loop through them as below to read them.

$item = Get-Item -Path "master:" -ID "{{Item_ID}}"
$fields = $item | Get-ItemField -ReturnType Field
foreach($field in $fields){
  Write-Host "Field Name: $($field.Name)"
  Write-Host "Field Value: $($item.Fields[$field.Name].Value)" 
}

This will return all the fields on the item which are not standard fields. In case you would like to fetch standard fields as well you can add -IncludeStandardFields flag to Get-ItemField function.

Note: In order to make sure $item.Fields returns all the fields, you will need to call $item.Fields.ReadAll() function before reading item fields as below.

$item.Fields.ReadAll()
# exclude standard fields.
$fields = $item.Fields | Where-Object { $_.Name -notlike '__**' }

We need to call ReadAll() function as above since Fields are lazy loaded, hence the call to this function is required to read all the fields.

Hope this helps!!!

You can use Get-ItemField function to get all item fields and loop through them as below to read them.

$item = Get-Item -Path "master:" -ID "{{Item_ID}}"
$fields = $item | Get-ItemField -ReturnType Field
foreach($field in $fields){
  Write-Host "Field Name: $($field.Name)"
  Write-Host "Field Value: $($item.Fields[$field.Name].Value)" 
}

This will return all the fields on the item which are not standard fields. In case you would like to fetch standard fields as well you can add -IncludeStandardFields flag to Get-ItemField function.

Note: In order to make sure $item.Fields returns all the fields, you will need to call $item.Fields.ReadAll() function before reading item fields as below.

$item.Fields.ReadAll()
$fields = $item.Fields

Hope this helps!!!

You can use Get-ItemField function to get all item fields and loop through them as below to read them.

$item = Get-Item -Path "master:" -ID "{{Item_ID}}"
$fields = $item | Get-ItemField -ReturnType Field
foreach($field in $fields){
  Write-Host "Field Name: $($field.Name)"
  Write-Host "Field Value: $($item.Fields[$field.Name].Value)" 
}

This will return all the fields on the item which are not standard fields. In case you would like to fetch standard fields as well you can add -IncludeStandardFields flag to Get-ItemField function.

Note: In order to make sure $item.Fields returns all the fields, you will need to call $item.Fields.ReadAll() function before reading item fields as below.

$item.Fields.ReadAll()
# exclude standard fields.
$fields = $item.Fields | Where-Object { $_.Name -notlike '__**' }

We need to call ReadAll() function as above since Fields are lazy loaded, hence the call to this function is required to read all the fields.

Hope this helps!!!

added 227 characters in body
Source Link
ckhanna
  • 3.7k
  • 1
  • 1
  • 12

You can use Get-ItemField function to get all item fields and loop through them as below to read them.

$item = Get-Item -Path "master:" -ID "{{Item_ID}}"
$fields = $item | Get-ItemField -ReturnType Field
foreach($field in $fields){
  Write-Host "Field Name: $($field.Name)"
  Write-Host "Field Value: $($item.Fields[$field.Name].Value)" 
}

This will return all the fields on the item which are not standard fields. In case you would like to fetch standard fields as well you can add -IncludeStandardFields flag to Get-ItemField function.

Note: In order to make sure $item.Fields returns all the fields, you will need to call $item.Fields.ReadAll() function before reading item fields as below.

$item.Fields.ReadAll()
$fields = $item.Fields

Hope this helps!!!

You can use Get-ItemField function to get all item fields and loop through them as below to read them.

$item = Get-Item -Path "master:" -ID "{{Item_ID}}"
$fields = $item | Get-ItemField -ReturnType Field
foreach($field in $fields){
  Write-Host "Field Name: $($field.Name)"
  Write-Host "Field Value: $($item.Fields[$field.Name].Value)" 
}

This will return all the fields on the item which are not standard fields. In case you would like to fetch standard fields as well you can add -IncludeStandardFields flag to Get-ItemField function.

Hope this helps!!!

You can use Get-ItemField function to get all item fields and loop through them as below to read them.

$item = Get-Item -Path "master:" -ID "{{Item_ID}}"
$fields = $item | Get-ItemField -ReturnType Field
foreach($field in $fields){
  Write-Host "Field Name: $($field.Name)"
  Write-Host "Field Value: $($item.Fields[$field.Name].Value)" 
}

This will return all the fields on the item which are not standard fields. In case you would like to fetch standard fields as well you can add -IncludeStandardFields flag to Get-ItemField function.

Note: In order to make sure $item.Fields returns all the fields, you will need to call $item.Fields.ReadAll() function before reading item fields as below.

$item.Fields.ReadAll()
$fields = $item.Fields

Hope this helps!!!

Source Link
ckhanna
  • 3.7k
  • 1
  • 1
  • 12
Loading