This project is read-only.

Powershell scripts

Sep 3, 2008 at 6:31 PM
I cannot figure out how to reference another document library from my script and get the value of an user added field...
With your variable $item, I'm able to access an added column like $item["articleid"] and retrieve the value, but when I use :
 $otherlibfile = $web.getfile(<otherlibfileurl>);
 $ArticleId = $otherlibfile["ArticleId"];
I receive "unable to index into an object of type 'Microsoft.Sharepoint.SPfile'.
I'm sure this is do-able in c#, but I'm missing something with the powershell implementation.
Sep 3, 2008 at 8:27 PM
Hi Joe,

try $ArticleId = $otherlibfile.Item["ArticleId"];
Thanks for the review.

Sep 4, 2008 at 1:17 PM
Edited Sep 4, 2008 at 5:13 PM
Sure no problem on the review, you deserve it!
About my problem, I've tried using the item["ArticleId"] but still recieve the "unable to index..."  error, however,
if I use $ArticleId = $otherlibfile.item;
then use $ArticleIdValue = $ArticleId["ArticleId"]; 
then $ArticleIDValue contains my value.. weird..
Anyway, thanks for your input, I think I'm almost over the hump on this exercise.
BTW, I did install the trial of NinTex. Looks like quite a few activities, installs easily, very impressive!
I'm wondering about the price though, usually something that polished is expensive :)
Take care,  Joe
Sep 4, 2008 at 2:40 PM
Joe, if you're intersted in Nintex, contact me, our Nintex customers get my nintex activities for free, at the moment this is only the PowerActivity for PowerShell.
May The "Power" Be With You...