You cannot call a method on a null-valued expression (powershell, sharepoint) -
i created powershell script purpose of reading text document , applying changes field in sharepoint environment. sorry errors in technical jargon im starting out , still learning. heres script:
$data = get-content "e:\projects.txt" write-host $data.count total lines read file foreach ($line in $data) { write-host $line $web = get-spweb -identity "http://bizprojectsqa.westerncape.gov.za/pwa/" $list = $web.getlist($line) $query = "<where><eq><fieldref name='status'/><value type='text'>(2)active</value></eq></where>" $view = $list.views["all active risks"] $view.query = $query $view.update(); }
heres error message:
cannot call method on null-valued expression. @ c:\temp\pwa_risks.ps1:12 char:13 +$view.update <<<< (); +categoryinfo : invalidoperation: (update:string) [], runtimeexception +fullyqualifiederrorid : invokemethodnull
i think has $view.update() im not 100% sure.
Comments
Post a Comment