Question profil powershell sur mon home network
- acidric
- Auteur du sujet
- Hors Ligne
- Nouveau membre
-
- Messages : 13
- Remerciements reçus 0
Bonsoir,
Sais-tu que tu peux utiliser différents emplacements pour les profils PowerShell ?
Sache que le résultat sera encore différent dans la console ISE car tu peux avoir également des profils propres à ISE.
Tout ça pour dire que si tu utilises un emplacement \"AllUsers...\" ton profil sera local et tu ne seras plus gêné par la redirection de profil de Windows.
Arnaud<br><br>Message édité par: Arnaud, à: 20/11/14 23:23
Bonjour,
Oui effectivement, je sais qu'il y a 4 emplacements.
Les 2 allusers sont en local chez moi, et les 2 currentuser en réseau. Ce qui semble logique vu la configuration.
Mon besoin c'est d'avoir mes profils powershell et ISE en local, et ne pas devoir recommencer à chaque reboot...
J'ai lu pas mal de chose sur ces notions de 4 profiles, mais j'avoue, que finalement c'est de moins en moins clair
A quel moment je spécifie le profil ? Pour moi, j'étais toujours dans le cas du 'currentusercurrenthost' ? non ?
Connexion ou Créer un compte pour participer à la conversation.
- Laurent Dardenne
- Hors Ligne
- Modérateur
-
- Messages : 6311
- Remerciements reçus 68
Comme ceci :bon déja, je vais chercher ce que signifie 'exécuté en dotsource'
[code:1] . 'C:\Users\Laurent\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'[/code:1]
Le point est un opérateur d'invocation/d'exécution, les variables et fonctions créées dans le script persistent une fois celui-ci terminé.
Voir aussi :
[code:1]help DOT SOURCING
help about_Scripts
[/code:1]
Tutoriels PowerShell
Connexion ou Créer un compte pour participer à la conversation.
- acidric
- Auteur du sujet
- Hors Ligne
- Nouveau membre
-
- Messages : 13
- Remerciements reçus 0
je comprends mieux, je vais essayer de tester cette solution, même si ca reste un contournement... mais c'est déja un très bon début si ca fonctionne
Merci
(bon finalement, quand je lis les sujets débutant et initié, j'aurais du mettre ca dans débutant... je le saurais pour le prochain
Connexion ou Créer un compte pour participer à la conversation.
- Laurent Dardenne
- Hors Ligne
- Modérateur
-
- Messages : 6311
- Remerciements reçus 68
Tutoriels PowerShell
Connexion ou Créer un compte pour participer à la conversation.
- Laurent Dardenne
- Hors Ligne
- Modérateur
-
- Messages : 6311
- Remerciements reçus 68
Je crains que cela le reste.même si ca reste un contournement...
J'ai regardé rapido le code de PS est le nom du chemin est codé en dur via cette classe [system.environment+specialfolder].
J'ai trouvé ceci sur MSConnect qui confirme le pb :
connect.microsoft.com/PowerShell/Feedback/Details/671292
Windows Powershell has the profile location hard-coded.
As a result, system administrators and end-users have no control over where the profile is stored.
Furthermore, the fixed location is in a location that is affected by other factors.
In particular, since the location is a subdirectory of the \"My Documents\" folder, it is affected by the location of My Documents,
which may be on a remote location and affected by other limitations of that location.
This causes problems when attempting to start up powershell in certain environments.
In particular, my user profiles are configured with My Documents as a remote share.
If that remote share is inaccessible, the Powershell can't be loaded.
If that share is accessible, but on a slow link, it takes a very long time for Powershell to startup.
Furthermore, it's not possible to have distinct powershell configurations per machine in this scenario.
If the user chooses to use a remote share for \"My Documents\", he is also forced to use that remote share for his Powershell Profile.
This issue has been brought up in the past.
See: connect.microsoft.com/feedback/ViewFeedb...=53055&SiteID=99 connect.microsoft.com/PowerShell/feedbac...iate-in-my-documents
There is a clear dissenting opinion, and I'm re-raising the issue, specifically because of the undesirable behavior the design creates.
In my opinion, the choice for the default location of the profile is a reasonable one, and the reasons given for the choice of the location are acceptable.
What is not acceptable, however, are the collateral faults that this design brings, especially when the location of the profile could be easily overridden
by a registry setting or (less desirable) a command-line argument to the powershell interpreter.
In #53055, Microsoft said, \"Changing the user location for PowerShell would be a breaking change at this point.\"
While it is true that changing the default location might be a breaking change,
it would be entirely reasonable to add a startup hook that checks a registry setting or similar, where end-users and administrators could define a custom location
to avoid the problems with loading a profile from a remote location. As of yet, no one has given a good reason why a user must be forced to (attempt to)
load the profile from a single, fixed location which already has other constraints placed on it.
I ran into this same problem with Remote Desktop (which stores its settings in %mydocuments%\default.rdp), but that was fixed with a hidden registry setting.
I ran into this same problem with Dropbox (which liked to place the dropbox in the %mydocuments% folder), but they fixed this by allowing the location to be
customized at installation. The only product I've ever used which consistently insists on not addressing these easily-reproducible problems is Powershell.
I find it particularly embarrassing when I'm demonstrating to another power user how great PowerShell is, but I have to apologize for the shortcomings.
These issues cause me lost productivity and consternation.
Please fix this issue.
Thanks.
Tutoriels PowerShell
Connexion ou Créer un compte pour participer à la conversation.
- Vous êtes ici :
-
Accueil
-
forum
-
PowerShell
-
Entraide pour les initiés
- profil powershell sur mon home network