Comments (4)
Thank you for those details. I completely understand and respect your choice. I will close out this issue as your answer makes sense and does help.
from adessentials.
Save-HTML comes from PSWriteHTML and its soft-way of fallback when the given path doesn't exist so that the file is not lost. Creating a path may be a dangerous way so I try not to do it and expect the user to do it themselves properly. Not sure I want to change that behavior as I am a bit afraid of the flaw in that logic and consequences for more complicated paths.
from adessentials.
Oh yes, I completely understand and agree that it can be a difficult thing. I guess the bigger reason I was thinking was let's say we schedule the report to run over multiple groups and to store the HTML in a folder that is named something dynamically. Well, the problem here is I now have to add it to my code to make sure that I create those dynamically named folders which means adding more code to my script/call.
So for example, here is my script.
$groupName = "[name]"
Show-WinADGroupMember -GroupName $groupName -FilePath (-Join("C:\Temp\Reports",$groupName,"GroupMembership.html"))
The method/call works GREAT, but it just has to fall back to saving the file to my "C:\Users[username]\AppData\Local\Temp[number].html" path to save the file. Maybe as an alternative (again, just a suggestion), an additional parameter could be used like "-Force" and combine it with a Test-Path method call? Of course I have to rely on your expertise and knowledge of the code and all to determine if this is really able to be used or not. If I need to put in a Pull Request for official work/review, I am more than happy to do so. :)
from adessentials.
What happens if the user makes a typo and it creates a path? I can't solve all problems. The Save-HTML is supposed to help if a mistake was made and the user was using cmd interactively. Surely if you're going to schedule something you can add 2-3 more lines of code?
The cmdlet can take multiple groups, so just create folder and use a single file for multiple groups?
Or add the single line above? New-Item -ItemType Directory "C:\Temp\Reports\" -Force
Also this join for sure doesn't give you C:\Temp\Reports\GroupNameGroupMembership.html
-FilePath (-Join("C:\Temp\Reports",$groupName,"GroupMembership.html"))
And if I would force it for you the C:\Temp\ReportsSomeGroupNameGroupMembership.html
would be used, and just C:\Temp would be created.
I do sometimes add dir creation with force of path - but I just don't feel this is the correct place to do it.
from adessentials.
Related Issues (20)
- Cannot Get-WinADGroupMemberOf of Identity with '@' symbol HOT 4
- IPAddressStatus* bugs in Get-WinADForestControllerInformation when DNS returns A records in the Additional section HOT 1
- Get-WinADGroupeMemberOf issue based on SamAccountNmae
- Limit Domain Controller Scope HOT 3
- How to get nested duplicate users? HOT 3
- Make large Number of Groups search and collapsable HOT 1
- “Remove-WinADDuplicateObject” having trouble to delete the duplicate object when ProtectedFromAccidentialDeletion = True
- get-WinADGroupMember* function doesn't handle special characters in group name
- Add support for GroupManagedServiceAccount HOT 1
- Get-WinADPrivilegedObjects incorrectly identifying group as orphaned HOT 2
- Authenticode issuer error when trying to install ADEssentials. HOT 1
- Request to translate AAD group names HOT 1
- Can this be used on Azure AD HOT 1
- Get-WinADForestDetails not working with WAN-Optimizer HOT 5
- New report - AD Objects Count per OU, per Category
- Functions not loading completely HOT 2
- Feature Request : Custom Icon based on keywords found in users and groups names HOT 1
- Display customised levels of descendents HOT 5
- PSWriteHTML files missing or mislabeled HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adessentials.