1

I have properties in my SharePoint web application, and I'd like to save them to text file. After calling $webApplication.Properties, I can see something like this:

Name                           Value
----                           -----
SchoolSiteUrlFormat            https://www.blablablablablablabl/sites/{school}
ApplicationDatabaseListsLoc... https://blablablablablablablabla/sites/zasobys...

How can I direct output from that command to file, where item name and value wouldn't contain those "..." at the and full value would be saved?

2 Answers 2

1

Try piping your output to Out-File with the Width parameter specified.

Do-Command | Out-File -width 300 -filepath "C:\temp\myoutput.log"

If not that, you could try piping it to Format-List and then Out-File.

0

I would export it as a comma separated text file (csv). If you need to see it nicely formatted, you can then use a spreadsheet reading program (e.g. excel).

Since the property looks like it is a dictionary, you would use the GetEnumerator() member function to extract the values and pipe it to the Export-Csv commandlet. Something like this:

$webApplication.Properties.GetEnumerator() | select name,value | export-csv -path "properties.csv" -NoTypeInformation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.