Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

what are the differecnes between "PushChangesToLists = $true" & "$field.update($true)" insie my powershell script

$
0
0
i am working on sharepoint 2013, and i want to write a power-shell script, which update an item visibility on Create forms, and i want to update all the references of this column inside existing lists. but i am confused if i should use `PushChangesToLists = $true` OR `$field.update($true)`, to update the site column and its referecnes inside exsisting lists.

so what are the differences between using $column.PushChangesToLists = $true with$column.Update() as follow:-

    $web = Get-SPWeb http://portal
    $column = $web.Fields["Test Column"]
    $column.PushChangesToLists = $true
    $column.ShowInNewForm = $false
    $column.Update()
    $web.Update()
    $web.Dispose()
& using $column.Update($true)only, as follow:-
    $web = Get-SPWeb http://portal
    $column = $web.Fields["Test Column"]
    # REMOVED $column.PushChangesToLists = $true
    $column.ShowInNewForm = $false
    $column.Update($true) # UPDATED
    $web.Update()
    $web.Dispose()



Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>