Skip to content

Instantly share code, notes, and snippets.

@buettiB
Last active May 12, 2017 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buettiB/1298a0ddd80b9026d0c8bf6f9f2fbbc5 to your computer and use it in GitHub Desktop.
Save buettiB/1298a0ddd80b9026d0c8bf6f9f2fbbc5 to your computer and use it in GitHub Desktop.
Erstellt Beispielelemente in einer SharePoint Liste
Add-PSSnapin Microsoft.SharePoint.PowerShell
cls
Write-Host "Start:" (Get-Date)
$list = (get-spweb http://hamburg/).Lists["Meine Liste"]
$auswahl = "Eins", "Zwei", "Drei"
for ($i = 1; $i -le 30; $i++)
{
$newItem = $list.Items.Add()
$newItem["Title"] = 'Element {0} erstellt {1}' -f $i,(Get-Date)
$newItem["Auswahl"] = $auswahl[(Get-Random -Maximum 3)]
$newItem.Update()
}
Write-Host "Ende:" (Get-Date)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment