![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Newbie ![]() Join Date: Mar 2008 XP
Posts: 2
| Variable and deepcopy Hello, this code does not copy the fields Options and Attributes : Code: $SMA="System.Management.Automation" $MyArray=@(2,4) $Count=New-object "$SMA.ValidateCountAttribute" 1,3 (Get-Variable MyArray).Attributes.add($Count) $Range=New-object "$SMA.ValidateRangeAttribute" 2,7 (Get-Variable MyArray).Attributes.add($Range) (Get-Variable MyArray).Options=[System.Management.Automation.ScopedItemOptions]"Allscope" Copy-Item -Path variable:MyArray -Destination variable:MyArray2 gv MyArray|fl * gv MyArray2|fl * Thanks. |
| | |
|
| |
| | #2 (permalink) |
| Newbie ![]() Join Date: Mar 2008 XP
Posts: 2
| Re: Variable and deepcopy For informations. About attribute (US) : http://www.manning.com/payette/wpia_errata.pdf About attribute (French) ftp://ftp-developpez.com/laurent-dardenne/articles/Windows/PowerShell/VariablesContraintes/fichiers/Les-variables-contraintes-sous-PowerShell.pdf "Deepcopy" : gv V|Export-Clixml Variable-V.xml $V2=Import-Clixml Variable-V.xml $V2.name= "V2" $v|gm $V2|gm Attention : The type of V is Int32 and the type of V2 is PsVariable. |
| | |
| |
| |