-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdotNet.ps1
More file actions
25 lines (17 loc) · 942 Bytes
/
dotNet.ps1
File metadata and controls
25 lines (17 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$ExecutionCommand= {
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version,Release -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSComputerName, PSChildName, Version, Release -ExcludeProperty RunspaceId
#write-host $RegVal
}
$collectionVariable = @()
Get-ADComputers -Filter * | %{ $Result=Invoke-Command -ComputerName $_ -ScriptBlock $ExecutionCommand ;
#$Result | Export-CSV -Path 'C:\Users\prodalexh\Desktop\dotNetVersions.csv' -Append -UseCulture
#$Result | Export-XLSX -Path 'C:\Users\prodalexh\Desktop\dotNetVersions.xlsx' -Append
$collectionVariable += $Result
#Write-Host ($Result | Format-Table | Out-String | )
#$Result | Add-Content 'C:\Users\prodalexh\Desktop\dotNetVersions.cvs'
}
#Write-Host $collectionVariable
$collectionVariable | Export-XLSX -Path 'C:\Users\prodalexh\Desktop\dotNetVersions.xlsx' -Append