Skip to main content
jfrmilner's user avatar
jfrmilner's user avatar
jfrmilner's user avatar
jfrmilner
  • Member for 11 years, 7 months
  • Last seen this week
Loading…
awarded
revised
Loading…
Loading…
comment
Powershell: Get-StoredCredential not working when script is run from task scheduler
Use the Start-Transcript and Stop-Transcript to create transcript of the script running as a job. Hopefully you'll see the issue more clearly i.e. Module not importing or similar.
Loading…
comment
Powershell batch command: Cannot escape backslash by doubling it when using "notlike"?
I've just tried line two '*\*' and it worked as expected for me (no escape needed). I used cmd to run the bat file containing the PowerShell code.
comment
Powershell batch command: Cannot escape backslash by doubling it when using "notlike"?
Do you need to read the actual command in the file, as in, it could be base64 encoded. I could provide an example if needed.
comment
Powershell batch command: Cannot escape backslash by doubling it when using "notlike"?
The reason replace works with "\\" is that it uses regular expression where as like uses wildcard expressions (different syntax and escape methods)
comment
Via Powershell Cannot Format Disk with File System NTFS?
Try using Format-Volume with the -Full switch.
awarded
awarded
comment
How to pass multiple automatic reponses to user prompts between batch files using powershell?
The issue here is when you run the .bat file it will run using cmd which has a different interpreter than PowerShell, for example the method you've used to pass the array will not work in cmd and is why the statup.bat fails. For a simpler life, pick one, either cmd and bat or PowerShell and ps1.
comment
Powershell variable will not iterate, value is empty
Don't Format-Table when creating your $users array. Remove this and try again.
Loading…
comment
Windows PowerShell how to handle colon character that stops output from printing to screen
I suspect 1.14.2281.0 is your Windows Terminal version. Could you run $PSVersionTable.PSVersion.ToString() so we can understand what version of PowerShell you're running and update the question with the output.
comment
how to access the parameters as array powershell
$args is an array of values for undeclared parameters that are passed to a function and you only passed declared parameters. I suggest you have a read of Get-Help about_functions and try the examples.
comment
Using reg.exe in a script with folder containing spaces
Try """reg import ""C:\Program Files\MyCompany\site1.reg"""
comment
Export all users for each Distribution Group I own into a csv
You'll need to use the Get-DistributionGroupMember cmdlet.
1
2 3 4 5 6