<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Export to excel</title><link>https://communities.bentley.com/products/projectwise/f/projectwise-powershell-extensions-forum/193370/export-to-excel</link><description>Hello 
 In my quest to undertsand PWShell 
 i have wrote this code 
 
 $Groups = Get-PWGroupNames 
 foreach ($Group in $Groups) { 
 $Group 
 Get-PWMembers -Type Group -Name $Group 
 } 
 
 Now i&amp;#39;m not sure how to output this in Excel so I have two colums</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Export to excel</title><link>https://communities.bentley.com/thread/572604?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 01:58:22 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ca0fe755-186d-4a08-bdef-4d1883e7c58b</guid><dc:creator>Brian Flaherty</dc:creator><description>&lt;p&gt;The cmdlet will create a worksheet with the Excel file for each of the datatables provided in the -InputTables parameter.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export to excel</title><link>https://communities.bentley.com/thread/572578?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 21:41:14 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:f90beee7-00e8-43ff-8b58-2af95b7fd6f0</guid><dc:creator>Luc Poulin</dc:creator><description>&lt;p&gt;Hello Brian another quick question&lt;/p&gt;
&lt;p&gt;Can the -InputTables&amp;nbsp;argument for New-XLSXWorkbook, &amp;nbsp;allow us&amp;nbsp;to add more than one value to create multiple tab in excel?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export to excel</title><link>https://communities.bentley.com/thread/572558?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 19:10:43 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5e770afa-e020-4854-b614-6f73dd810e18</guid><dc:creator>Luc Poulin</dc:creator><description>&lt;p&gt;Thank you Brian&lt;/p&gt;
&lt;p&gt;This make me ask one question, based on when I was helping&amp;nbsp; programmer but note doing any coding. Do we have documentation that allow us, newbie coders, to know the expected return&amp;nbsp;string for&amp;nbsp;an argument or trigger ( not sure what is the correct term to be use)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Some kind of correlation table&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;For user inside a group below are the support argument/trigger&lt;/p&gt;
&lt;p&gt;&amp;nbsp;.MemberType = xxxx&lt;/p&gt;
&lt;p&gt;.MemberName = xxxx&lt;/p&gt;
&lt;p&gt;.MemberDomain = xxxx&lt;/p&gt;
&lt;p&gt;.MemberDescription = xxxxxx&lt;/p&gt;
&lt;p&gt;And each could be associate in an infographic&amp;nbsp;to the graphical interface ( when&amp;nbsp;the result is expose in the user interface)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/343592/Untitled.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Export to excel</title><link>https://communities.bentley.com/thread/572474?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 11:17:39 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:4e744640-d34c-4262-8eb7-858e6eaf4aea</guid><dc:creator>Brian Flaherty</dc:creator><description>&lt;p&gt;Give this a try&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="powershell"&gt;# Create datatable and add desired columns.
$dt = New-Object Data.Datatable (&amp;#39;Users&amp;#39;)
$dt.Columns.Add(&amp;quot;GroupName&amp;quot;)
$dt.Columns.Add(&amp;quot;MemberType&amp;quot;)
$dt.Columns.Add(&amp;quot;UserName&amp;quot;)

$Groups = Get-PWGroupNames

foreach ($Group in $Groups) {

    $pwGroupMembers = Get-PWMembers -Type Group -Name $Group

    # Loop through all group members and add to the datatable.
    foreach($pwGroupMember in $pwGroupMembers) { 
        $dr = $dt.NewRow()
        
        $dr.GroupName = $Group
        $dr.MemberType = $pwGroupMember.MemberType
        $dr.UserName = $pwGroupMember.MemberName
    
        $dt.Rows.Add($dr)
    }
}

# Export to Excel file.
New-XLSXWorkbook -InputTables $dt -OutputFileName &amp;#39;d:\temp\export\GroupMembership.xlsx&amp;#39;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>