Powershell; Write a file and open it

I have found this code quite helpful in debugging - especially trying to look through a large xml schema file for a SharePoint list.

$fileName = "myFile.txt"

# Write some variable property to a file
$web = Get-SPWeb "http://blah.com"
$list = $web.Lists["My List"]
$list.SchemaXml > $fileName

# Open the file in notepad
 Start-Process notepad  -ArgumentList $fileName

Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

How can I call a JIRA api through Powershell?