I'm hoping this is a nice quick one. I have 11 scripts setup to check whether Microsoft Licenses are directly assigned or not. I then have a master.ps1 that will run all these scripts one after the other. What I want to achieve, is to basically export the results from the master.ps1 after it's finished running. All the scripts are the same, the only difference being that the license names change. So for example, checking the EMS license:
$skuId = "contoso:SPE_E3"
`Get-MsolUser -All | where {$_.isLicensed -eq $true -and $_.Licenses.AccountSKUID -eq $skuId} | select UserPrincipalName,
@{Name="SkuId";Expression={$skuId}},
@{Name="AssignedDirectly";Expression={(UserHasLicenseAssignedDirectly $_ $skuId)}},
@{Name="AssignedFromGroup";Expression={(UserHasLicenseAssignedFromGroup $_ $skuId)}}`
The master.ps1 will be as follows:
&"$PSScriptroot\Script1.ps1"
&"$PSScriptroot\Script2.ps1"
&"$PSScriptroot\Script3.ps1"
Etc
I've tried adding Export-CSV after the master file but it doesn't work, can anyone assist please?