I would like to copy an Attribute from one Environment to another i the same datasource. I have the following:
$datasource = 'FakeBeforcolon:FakeAfter'
$VerbosePreference = 'Continue'
$ErrorActionPreference = 'Continue'
Write-Verbose "Connecting to $datasource"
New-PWLogin -DatasourceName $datasource -BentleyIMS
#Copy the Attribute
Copy-PWEnvironmentColumn -SourceEnvironmentName 'Title Block' -TargetEnvironmentName 'CADD Files' -ColumnName 'Print_Type'
This will create an Attribute in the CADD Files Environment but does not seem to copy the Attribute. I say this because:
There are no other items to check in the newly created Attribute so checking other items does not seem possible.
Also, in the target Environment, the newly created Attribute is added to the 'More Attributes' tab but is only listed as an item, not shown as a positioned field as if it was created manually.
What am I missing? Are there other things, such as the Data type and Length that are not being copied as well?
There are various cmdlets that have 'PWAttribute' in the name. For example, Set-PWAttributeValueListSettings will let you add the SELECT statement and Length and Format String are in Set-PWAttributeEditingSettings
You are saying I need to Copy it, then copy any attributes of it that I want to copy and that there is not actual Copy? If that is the case, what is the use of the copy? Why wouldn't I just create a new name and then copy each item?