Sign in to join the PowerShell Group
-
You can connect to other Microsoft services in the same manner e.g., Connect-MsolService, Connect-AzAccount, or Connect-AzureAD
-
Is there a way to make PowerShell report to compliance to Conditional Access policies that require compliant devices?
-
Brandon Lee wrote a new post 1 day, 5 hours ago
Connect to Exchange Online with PowerShell
Learn how to connect to Exchange Online PowerShell using multifactor authentication.
-
Balwant Chandel joined the group
PowerShell 1 day, 6 hours ago
-
DivineOrator commented on
PowerShell Classes – Part 4: Constructors 3 days, 4 hours ago
And in as little as 3 years, that website no longer exists/is accessible. If you want to read more about constructors, I recommend a website that will never change: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_classes?view=powershell-7.3
-
David Figueroa commented on
How to create an open file/folder dialog box with PowerShell 4 days, 19 hours ago
That may or may not work.. you normally check along the lines of “$result = $fbdialog.ShowDialog(); if ($null -eq $result) { #cancel pushed }”
David F.
-
Maybe I’m wrong, but I didn’t think you could “preserve” a hardlink?
From a practical perspective, you’re creating a new MFT entry that points to the same data, much in the same way with linux, you’re creating a new entry that points to the same inode. When you delete the file, the data is gone, and the link is killed.. But, when you copy the file (from either MFT entry, nothing gets changed). I don’t think there’s anything to preserve? The hard link exists within the volume’s MFT so it can only point to data in the same MFT.
If you are talking about a symbolic link, that’s different. The symbolic link is just a pointer that says “go to this location for the data”. It can point to other locations, UNC paths, etc. You can also set a flag (either /SL or /SJ) in robocopy to copy the symbolic links/junctions as links/junctions, rather than copying the target of the link/junction. (It helps keep you from getting stuck in an endless loop where a link points to a directory higher in it’s own path.
If someone has more or different information I’d be interested.
David F.
-
You better put “intelligence” in quotes because “artificial” is correct. I mean nobody would assume that an artificial tree made of plastic is a real tree, right?
-
ChatGPT–putting the ‘artificial’ in artificial intelligence, lol.
-
Joshua Szanto commented on
How to create an open file/folder dialog box with PowerShell 6 days, 4 hours ago
Execution hangs up on usage of ShowDialog() under PowerShell 7 for me; it just stalls out. Another colleague does not have the same issue in PowerShell 7. Works fine in PowerShell 5.1 though. Any ideas? Been searching high and low and not sure why it stalls out upon executing ShowDialog() line in PoSh7.
-
Thanks!
Shame on me! I also asked ChatGPT 4 relatively simple questions about Powershell and Python and received only one correct answer. The answer style makes you believe that the AI is ‘convinced’ of the correctness of the given information… -
David Figueroa commented on
Where-Object vs. the Where method: Array filtering in PowerShell 6 days, 17 hours ago
First time I’ve seen this article.. but it is worth noting you can change the syntax slightly.. You can “drop” the parentheses and just use braces.
$array.where{ # do stuff }
And another important thing to note is that the .where{} is case sensitive, where as the where-object is *not* case-sensitive.
David F.
-
Clifford Williams commented on
Where-Object vs. the Where method: Array filtering in PowerShell 1 week, 1 day ago
I know this is old but this article returns high in search results.
For anyone reading this it is important to understand that array.where will always return a collection. even it the query returns a single object, while Where-object will return a PSCustomeObject if the query returns a single object.This is usually not an issue unless you are trying to get the index of an object in an array.
$Object = $Array.Where({$_.property -eq $true})
$index = $array.indexOf($Object)
in the above example index will be -1 because $object will not be found.
Where,
$Object = $Array | Where-Object{$_.property -eq $true}
$index = $array.indexOf($Object)
Will return the index of $Object.You can get around this by indexing the collection return by the .Where method.
$Object = ($Array.Where($_.property -eq $true))[0]
$index = $array.indexOf($Object) -
Jon Irish commented on
Perform Active Directory security assessment using PowerShell 1 week, 1 day ago
The issue appears to be the way browsers display the REGEX lines (40-66). I downloaded the raw data from Github and everything was fine… odd. Has anyone made a list of all of the Config.ini options available?
-
Notepad++ screwed even with copying RAW from github.
Easiest was to paste raw directly into Powershell ISE and this seems to work.Of course after editing the config.ini to your personal settings…. 🙂
-
nooneoneno commented on
Fast event log search in PowerShell with the FilterHashtable parameter 1 week, 3 days ago
Thanks a lot for this article, helped me for my purpose.
-
It seems you encountered a typical ChatGPT hallucination because the /b switch stands for “backup mode” and not “binary mode.” Check out the robocopy documentation.
-
Steve commented on
Robocopy examples 1 week, 5 days ago
I just was playing aroung with ChatGPT and asked how to preserve NTFS hardlinks when copying files from one drive to another. The answer was that the option /B of robocopy “causes the files to be copied in binary mode, so all attributes and properties, including hardlinks, are preserved.” I never used the option /B.
It would be great if you could you say something about this option. -
Steve commented on
Robocopy examples 1 week, 5 days ago
Some programs do change few bytes in files without altering the timestamps.
Microsoft Office did so (or still does?) in files of the old DOC, XLS, PPT format. As I remember, it was enough to open and close the files to see the changes. -
Just noticed the angle brackets got deleted from my post.. but it looks like we had the same thoughts..
machinename and the full path to the .ps1 file.
PSExec is going to start in System32 by default if I remember correctly.
David F.
- Load More