Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#User details#>
- $user = „administrator“
- $password = cat filesystem::c:Userspraktikant2Desktopmingifail.txt | convertto-securestring
- $me = new-object -typename System.Management.Automation.PSCredential -argumentlist $user, $password
- $list = Invoke-Command -cn Fillerhere -ScriptBlock {Get-ItemProperty HKLM:SoftwareMicrosoftWindowsCurrentVersionUninstall* | select DisplayName, Publisher, Version, EstimatedSize, UninstallString} -Credential $me
- $list | Select-Object DisplayName, Publisher, Version, EstimatedSize, UninstallString | Export-Csv -Path C:Userspraktikant2DesktopLoeteludprogloetelu$((get-date).tostring('dd-MM-yyyy-hh-mm-ss')).csv -Encoding ascii -NoTypeInformation -Delimiter ';'
- $excel = New-Object -ComObject Excel.application
- $path = gci C:Userspraktikant2DesktopLists | sort LastWriteTime | select -last 1
- $excel.Visible = $false
- $openfile = $excel.workbooks.open($path);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement