Thanks to visit codestin.com
Credit goes to github.com

Skip to content
tfarray edited this page Dec 15, 2016 · 5 revisions

Table of Contents

Welcome to the SmartSheet_Powershell_Module wiki!

Installation of the module

  • Copy the directory Smartsheet to C:\Program Files\WindowsPowerShell\Modules\
  • Run powershell
    Set-ExecutionPolicy bypass
    Set-SmartSheetAPIToken [Your Token]
    import-module smartsheet

Get a smartsheet onscreen

    $ss = get-smartsheet MySmartSheet
    $ss.table | ft -autosize

if you want a graphical view, you can also do

    $ss.table | Out-GridView

Update a smartsheet row

We have a sheet with 2 column : name, age I want to update the age of Thomas F. :

    $Row = $ss.table | ? { $_.name -like "Thomas F." }
    $Row.Age = 40
    $Row.update()

Add / remove rows

I want to add a new row at the top of the smartsheet :

    $NewRow = new-object psobject -property @{name = "Albert G."}
    Add-SmartSheetRow $Row -SS $SS

I want to add a row just after Thomas F., and I want to use this Row as model

    $ReferenceRow =  $ss.table | ? { $_.name -like "Thomas F." }
    $NewRow = new-object psobject -property @{name = "Albert G."}
    # Method 1
     Add-SmartSheetRow $NewRow -ReferenceRow $ReferenceRow -Placement siblingId
    # Method 2
     $ReferenceRow.AddRow($NewRow)

I want to add a new Child Row

    $ReferenceRow.AddChild($NewRow)

What the @?!@# this module is doing

If you want to see what is happening behind the scene, you may add -verbose to any command

    Get-smartsheet MySS -verbose

you will then see the Jason data, the Web request ... and so on