1、在Windows 7系统上,如何启动XP模式虚拟机系统并安装使PowerShell正常工作的组件以及相关软件?步骤为:先启动XP模式虚拟机系统,点击“开始”→“所有程序”→“Windows虚拟PC”→选择“虚拟Windows XP”;待虚拟Windows XP加载完成后,安装使PowerShell正常工作的组件;接着下载并安装想在XP上安装的32位版本的.NET Framework;最后下载并安装32位版本的Windows管理框架。
在Windows 7系统中,启动XP模式虚拟系统。操作步骤为:
- 点击“开始”。
- 依次选择“所有程序” > “Windows虚拟PC”。
- 然后选择“虚拟Windows XP”。
待虚拟Windows XP加载完毕后:
- 安装让PowerShell运行的组件。
- 下载并安装打算在XP系统使用的32位版本 .NET Framework。
- 再下载并安装32位版本的Windows管理框架。
2、使用命令 New - Item - Path $profile - ItemType File - force 创建一个配置文件。使用 notepad $profile 打开该配置文件。输入命令 Import - Module - Name ActiveDirectory 和 Import - Module - Name WebAdministration 来加载服务器上用于 IIS 和 Active Directory 的适当模块(或者选择加载其他角色)。在记事本中保存配置文件并关闭它。退出当前的 PowerShell 会话。启动 PowerShell 并运行 Get - Module 来验证模块是否正确加载。
按照以下步骤操作:
- 使用命令
New-Item -Path $profile -ItemType File -Force创建配置文件,该命令会在必要时创建所需的目录和文件,默认会在%UserProfile%\My Documents\WindowsPowerShell目录下创建名为Microsoft.PowerShell_profile.ps1的脚本文件,此配置文件仅影响当前用户的当前 shell。 - 使用命令
notepad $profile打开配置文件。 - 在打开的记事本中输入以下命令以加载 IIS 和 Active Directory 模块:
powershell Import-Module -Name ActiveDirectory Import-Module -Name WebAdministration
若未安装这些角色,可选择加载其他角色;若不确定要加载哪些模块,可使用 Get-Module -ListAvailable 查看可用模块列表。
4. 在记事本中选择“文件” → “保存”,然后关闭记事本。
5. 退出当前的 PowerShell 会话。
6. 启动 PowerShell 并运行 Get-Module 命令,以验证模块是否已正确加载。
3、使用命令 Write - Host ‘Here are the programs in the Run Registry’、Get - ItemProperty - path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\run、Write - Host ‘Here are the programs in the RunOnce Registry:’ 和 Get - ItemProperty - path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\runOnce 创建一个 PowerShell 脚本来查找启动程序。
以下是满足需求的 PowerShell 脚本:
Write-Host 'Here are the programs in the Run Registry'
Get-ItemProperty -path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\run

最低0.47元/天 解锁文章
623

被折叠的 条评论
为什么被折叠?



