User Profile
fatherjack
Copper Contributor
Joined 6 years ago
User Widgets
Recent Discussions
Re: array limitations?
Maureen77 First thing I have noticed here is that you are running Get-Content $sCARDHIST1 twice, you would save time by running this into a variable once and then use that variable for your $Content = Get-Content $sCARDHIST1 # get the count $Content.count # and then the duplicate rows $Content | Group-Object ... As the file numbers and sizes grows though you will encounter more and more performance problems, loading 782Mb of a text file into memory and then sorting each row will not be a fast process in PowerShell. Depending on row size that is a _lot_ of rows4.7KViews0likes0CommentsRe: Passing credentials to SQL connection string
I'd recommend looking at the DbaTools module as that includes an Invoke-DbaQuery function which, like most of its hundreds of other funnctions, allows you to pass in credentials as a parameter for authentication at the SQL Server as your chosen domain user11KViews0likes0CommentsHow to compress images in all PowerPoint files in a folder
Hi, I have a project where I am being sent a lot of slide decks and while some authors create a very compact pptx others are adding images that are top quality (300dpi) and this leads to a very large pptx which I need to open, edit, compress images and re-save. I'd love to be able to automate this from PowerShell so I can bulk process all files in a directory but I cant see any image compression method in the PowerPoint SMO. Can anyone advise if its possible and what references might assist me please?833Views0likes0CommentsRe: Select-Object Substring Blank
Thisisit Other answers have mentioned a few issues with your script that I would agree with but I also wanted to present an alternate method of retrieving the information that you wanted. Line 2 uses a Regular Expression to match the last 10 non-space characters of the DirectoryName property and then line 6 references the $Matches variable for that value for the output. get-childitem c:\windows\system32 -file -recurse -ea silentlycontinue |foreach-object { $null = $_.DirectoryName -match '(?<LastTen>\S{10})$' [PSCustomObject]@{ Name = $_.name Directory = $_.DirectoryName Directory_Last10 = $matches.LastTen } }3.8KViews0likes2CommentsRe: Hello, I ran into a strange problem when I was using PowerShell 5.1
"/c" is not a PowerShell parameter. All PowerShell parameters begin with '-'. Check for a profile on the problem server, or run the command with -NoProfile to avoid load it on any servers. Loading the profile might be adding the extra time that you are observing.949Views0likes0CommentsPowerPoint SMO - compressing images
Hi, I am being sent a lot of slide decks and while some authors create a very compact pptx others are adding images that are top quality (300dpi) and this leads to a very large pptx which I need to open, edit, compress images and re-save. I'd love to be able to automate this from PowerShell so I can bulk-process all files in a directory but I cant see any image compression method in the PowerPoint SMO. Can anyone advise if its possible and what references might assist me please?809Views0likes0Comments
Recent Blog Articles
No content to show