Operating system: Windows 2k16 Server
PowerShell version(s): Powershell 5
Hello all from France,
I'm creating a tool that manage users in active directory, and many other automatic stuf. In this project i use NTFSSECURITY module in powershell.
On the first launch of the tool, it create all environment needed, registry keys, OU in AD etc ... it also copy files needed to import module with this function :
Code: Select all
function copiemodulentfs
{
param (
[Parameter(Mandatory = $true, Position = 0)]
[string]$nomserveur)
$ScriptDirectory = Get-ScriptDirectory
$modulentfs = "Microsoft.PowerShell.Core\FileSystem::$($ScriptDirectory)\config\Module_powershell\ntfssecurity\"
$destination = "Microsoft.PowerShell.Core\FileSystem::\\$nomserveur\c$\Program Files\WindowsPowerShell\Modules\"
Copy-Item -path $modulentfs -Destination $destination -Recurse
}
$nomserveur is a variable for server name.
this function work well. After that i try to import module with this command :
Code: Select all
Import-module ntfssecurity
If i use this command in powershell directly module is imported. But i can't do it through Powershell Studio. Any ideas ?
Thanks !