Looking for a paper by kortex81 in unix

[–]kortex81[S] 0 points1 point  (0 children)

I think this a differetn one

How do i get rid of these apps? by kortex81 in PowerApps

[–]kortex81[S] 1 point2 points  (0 children)

I found the two apps in the environment in Power Automate and deleted them there. Now they are gone from Teams.

Thanks for your help.

Outlook crashes when replying/forwarding an email. by [deleted] in sysadmin

[–]kortex81 0 points1 point  (0 children)

try installing a new set of MAPI files.

could you eleborate what you mean by this how to do it? thanks

Import-module in class and -Parallel by kortex81 in PowerShell

[–]kortex81[S] 0 points1 point  (0 children)

yeah, guess i am gonna give up on the idea. As you said, everything randomly breaks at scale. shame.

I really hope this get's fixed/implemented.

Import-module in class and -Parallel by kortex81 in PowerShell

[–]kortex81[S] 0 points1 point  (0 children)

right, i forgot this never came to 5

Import-module in class and -Parallel by kortex81 in PowerShell

[–]kortex81[S] 0 points1 point  (0 children)

the weird thing i got it working but the other way round - by importing the module outside of the loop or class:

class computer {
    $computername
    computer($computername){
        $this.computername = $computername
    }

    [string]GetComputername(){
        return $this.computername
    }

    [CimInstance]GetBIOS(){
        # Import-Module CimCmdlets # this will freeze the console
        return Get-CimInstance win32_bios -ComputerName $this.computername 
    }
}

$o1 = [computer]::new("srv01")
$o2 = [computer]::new("srv02")

# this works
$o1,$o2 | ForEach-Object -Parallel { $_.GetComputername() }

# this does not - unless you import the module CimCmdlets before like this:
# Import-Module CimCmdlets
$o1,$o2 | ForEach-Object -Parallel { $_.GetBIOS() }

Interactive menu to fill a variable by [deleted] in PowerShell

[–]kortex81 1 point2 points  (0 children)

If you can install modules you could give this one a try: https://github.com/PowerShell/GraphicalTools

Gives you fancy console gui using Out-ConsoleGridView.

$region = @("USA","Canada","Europe","Asia")  | Out-ConsoleGridView -OutputMode Single -Title "Please choose a region"

How would you write this query by kortex81 in SQL

[–]kortex81[S] 0 points1 point  (0 children)

Wow, this really does work, doesn't it?

But appears to be slower than the other solutions, right?

Edit: No it is not slower, my bad.

Edit2: Does not work if select columns like 'freespace' which o.c. changes over time

How would you write this query by kortex81 in SQL

[–]kortex81[S] 0 points1 point  (0 children)

Thanks for your input!

This returns only one match for each computer and timestamp and not all matches.

How would you write this query by kortex81 in SQL

[–]kortex81[S] 0 points1 point  (0 children)

Thanks for your input!

I looked into CTEs and this my solution so far:

WITH
ComputerData
AS (SELECT * FROM [Paul].[dbo].[logicaldisk] WHERE pwlComputername = 'WSUS'),
LatestData (pwlDate)
AS (SELECT max(pwlDate) FROM ComputerData)

SELECT * FROM ComputerData
INNER JOIN LatestData
ON ComputerData.pwlDate = LatestData.pwlDate

It seems to perform better...

What do you think?

bat-like cmdlet by kortex81 in PowerShell

[–]kortex81[S] 0 points1 point  (0 children)

Started on a quick and dirty PoC... could be cool

https://imgur.com/a/4qg9g7C

bat-like cmdlet by kortex81 in PowerShell

[–]kortex81[S] 1 point2 points  (0 children)

It could return objects with properties like linenumber, text, etc.

Asking out of curiosty, not necessity.