public Ps1ScaffolderLocator(IPowershellCommandInvoker commandInvoker, IPackageManager packageManager, IPackagePathResolver pathResolver, FileSystem.IFileSystem fileSystem, IScaffoldingConfigStore configStore) { _commandInvoker = commandInvoker; _packageManager = packageManager; _pathResolver = pathResolver ?? packageManager.PathResolver; _fileSystem = fileSystem; _configStore = configStore; }
internal ScaffoldingBaseCmdlet(ISolutionManager solutionManager, IVsPackageManagerFactory vsPackageManagerFactory, IPowershellCommandInvoker commandInvoker) : base(solutionManager, vsPackageManagerFactory) { // Command intrinsics can't be accessed until the PSCmdlet enters the "ProcessRecord" phase, // so we have to defer evaluation of the following things until then. To support unit testing, // it's possible to override their instantiation by passing a non-null instance to the constructor. _commandInvoker = new Lazy <IPowershellCommandInvoker>(() => { return(commandInvoker ?? new DefaultPowershellCommandInvoker(InvokeCommand, MyInvocation)); }); }
internal InvokeScaffolderCmdlet(ISolutionManager solutionManager, IVsPackageManagerFactory vsPackageManagerFactory, IScaffolderLocator scaffolderLocator, IPowershellCommandInvoker commandInvoker) : base(solutionManager, vsPackageManagerFactory, commandInvoker) { // Can't read the value of CommandInvoker until *after* the constructor finishes, hence lazy _scaffolderLocator = new Lazy <IScaffolderLocator>( () => scaffolderLocator ?? new Ps1ScaffolderLocator(CommandInvoker, PackageManager, null, new DefaultFileSystem(), new XmlScaffoldingConfigStore(SolutionManager)) ); _staticAndCommonParameterNames = new Lazy <IList <string> >( () => CommandInvoker.GetCommand("Invoke-Scaffolder", CommandTypes.Cmdlet).Parameters.Select(x => x.Key).ToList() ); }