Remove-ItemProperty 帮助信息

介绍 PowerShell 命令 Remove-ItemProperty 的使用方法,包括语法、参数详解及示例,用于从项目中删除属性及其值。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 
如下说明是翻译: help Remove-ItemProperty 产生的帮助信息.
译者: Edengundam(马涛)
 
Remove-ItemProperty
 
大纲
从一个项目中删除属性及其对应的值.
 
语法
Remove-ItemProperty [-path] <string[]> [-name] <string[]> [-include <string[]>] [-force] [-exclude <string[]>] [-credential <PSCredential>] [-filter <string>] [-whatIf] [-confirm] [<CommonParameters>]
 
Remove-ItemProperty [-literalPath] <string[]> [-name] <string[]> [-include <string[]>] [-force] [-exclude <string[]>] [-credential <PSCredential>] [-filter <string>] [-whatIf] [-confirm] [<CommonParameters>]
 
详细描述
emove-ItemProperty cmdlet从一个项目中删除属性及其对应的值. 你可以使用此命令删除注册表值及其存储的数据.
 
参数
 
-path <string[]>
指定包含了要移除属性的项目路径. 允许使用通配符.
 
强制参数?
true
参数位置?
1
默认值
N/A - 必须指定路径
允许从管道绑定输入?
true (根据值, 根据属性名)
允许通配符扩展?
true
 
-name <string[]>
指定要移除属性的名称.
 
强制参数?
true
参数位置?
2
默认值
String.empty
允许从管道绑定输入?
true (根据属性名)
允许通配符扩展?
false
 
-include <string[]>
只删除指定的项目. 此参数值用于限定Path参数. 输入一个路径元素或模式, 例如"*.txt"(此参数允许通配符).允许使用通配符.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
true
 
-force <SwitchParameter>
在不破坏安全性的前提下, 能够避免影响命令成功执行的限制条件, 例如: Force参数能够覆盖具有只读属性的文件或创建路径中的必要成分, 但是不会改变人和文件的权限.
 
强制参数?
false
参数位置?
named
默认值
False
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-exclude <string[]>
忽略指定的项目. 此参数值用于限定Path参数. 输入一个路径元素或模式, 例如"*.txt"(此参数允许通配符).允许使用通配符.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
true
 
-credential <PSCredential>
使用其他凭证进行资源访问认证. <Credential>代表着用户名(例如: "User01""Domain01/User01") 或者PSCredential对象(例如: 通过Get-Credential cmdlet取得的对象). 如果此处使用用户名, 命令执行时会提示输入该用户密码. 尽管此参数出现, 但是并非所有Windows PowerShell核心cmdletsproviders支持此功能.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
true (根据属性名)
允许通配符扩展?
false
 
-filter <string>
指定特定provider格式或语言的过滤器.此参数值用于限定Path参数. 过滤器的语法取决于provider(是否支持通配符也依赖provider). 过滤器相比其他参数更加有效, 主要因为provider取值时候使用过滤器, 而不是等到provider将所有内容返回后, Windows PowerShell 过滤对象.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
true
 
-literalPath <string[]>
指定项目属性的路径. 参数-LiteralPath的值将会按照输入的形式被使用. 不会对任何通配符进行解释. 如果路径中包含了转义字符, 需要将路径用单引号保护. 单引号指示Windows PowerShell不对字符串中的转义字符进行处理.
强制参数?
true
参数位置?
1
默认值
 
允许从管道绑定输入?
true (根据属性名)
允许通配符扩展?
false
 
-whatIf
描述执行此命令将会发生的现象, 不会真正执行此命令.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-confirm
执行命令前提示你进行确认.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
false
 
<公共参数>
此命令支持公共参数: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. 更多信息, 输入, "get-help about_commonparameters".
 
返回类型
None
 
注意
 
更多信息, 输入"Get-Help Remove-ItemProperty -detailed".需要技术信息, 输入"Get-Help Remove-ItemProperty -full".
 
Windows PowerShell注册表提供程序中, 注册表值被认为是注册表键或子键的属性. 你可以使用ItemProperty类的cmdlet来管理这些值.
 
如果需要为该命令提供多个参数, 请使用逗号进行分隔. 例如, "<parameter-name> <value1>, <value2>".
 
你可以使用Remove-ItemProperty内建别名"rp". 需要更多信息, 查看About_Alias.
 
1
 
C:/PS>remove-itemproperty -path HKLM:/Software/SmpApplication -name SmpProperty
 
此命令从HKEY_LOCAL_MACHINE/Software项上, 删除SmpApplication子项的SmpProperty注册表值及其数据.
 
Windows PowerShell的注册表中, 由于此命令是从文件系统驱动器上目录(C:/PS>)发出的, 他必须包含SmpApplication子键的完全限定名称, 包含驱动器名称(HKLM:), 以及Software.
 
此命令使用了Name参数来识别要删除的注册表值.
 
2
 
C:/PS>set-location HKCU:/Software/MyCompany/MyApp
 
PS HKCU:/Software/MyCompany/MyApp>remove-itemproperty -path . -Name Options -confirm
 
这些命令从HKEY_CURRENT_USER/Software/MyCompany 项上, 删除MyApp子项的Options注册表值及其数据.
 
第一个命令首先使用Set-Location cmdlet改变当前工作目录到HKEY_CURRENT_USER驱动器(HKCU:)中的oftware/MyCompany/MyApp子项
 
第二个命令使用Remove-ItemProperty cmdletMyApp子项上删除注册表值Options及其数据. 因为Path参数是强制出现的, 此命令使用点(.)来指示在当前目录应用命令. 它使用Name参数指定哪些注册表值被删除. 通过使用Confirm参数要求在删除注册表值之前提示用户进行确认.
 
相关链接
Set-ItemProperty
Clear-ItemProperty
Copy-ItemProperty
Move-ItemProperty
New-ItemProperty
Get-ItemProperty
Rename-ItemProperty
about_namespace
 
<template> <div class="app-container"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form-item label="" prop="roomCode"> <el-input v-model="queryParams.roomCode" placeholder="输入房间号查询" clearable @keyup.enter.native="handleQuery" /> </el-form-item> <!-- ???????? --> <el-form-item prop="buildingId"> <el-select v-model="queryParams.buildingId" placeholder="选择楼宇"> <el-option v-for="item in listBuilding" :key="item.buildingId" :label="item.buildingName" :value="item.buildingId" ></el-option> </el-select> </el-form-item> <!-- ???????? --> <el-form-item prop="unitId"> <el-select v-model="queryParams.unitId" placeholder="选择单元"> <el-option v-for="item in listUnit" :key="item.unitId" :label="item.unitName" :value="item.unitId" ></el-option> </el-select> </el-form-item> <!-- ????????? --> <el-form-item prop="purpose"> <el-select v-model="queryParams.purpose" placeholder="选择用途" clearable> <el-option v-for="dict in dict.type.wy_room_purpose" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </el-form-item> <el-form-item> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> </el-form-item> </el-form> <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['property:room:add']" >新增</el-button> </el-col> <el-col :span="1.5"> <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['property:room:edit']" >修改</el-button> </el-col> <el-col :span="1.5"> <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['property:room:remove']" >删除</el-button> </el-col> <el-col :span="1.5"> <el-button type="success" plain icon="el-icon-link" size="mini" :disabled="multiple" @click="resetQuery" v-hasPermi="['property:room:export111']" >已关联住户</el-button> </el-col> <el-col :span="1.5"> <el-button type="success" plain icon="el-icon-link" size="mini" :disabled="multiple" @click="resetQuery" v-hasPermi="['property:room:export111']" >未关联住户</el-button> </el-col> <el-col :span="1.5"> <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['property:room:export']" >导出</el-button> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> <el-table v-loading="loading" :data="roomList" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center" /> <el-table-column label="房间号" align="center" prop="roomCode" /> <!-- ???????? --> <el-table-column label="楼宇名称" align="center" prop="building.buildingName" /> <el-table-column label="单元名称" align="center" prop="unit.unitName" /> <el-table-column label="楼层" align="center" prop="floor.floorCode" /> <!-- ???????? --> <el-table-column label="用途" align="center" prop="purpose" > <template slot-scope="scope"> <dict-tag :options="dict.type.wy_room_purpose" :value="scope.row.purpose"/> </template> </el-table-column> <el-table-column label="建筑面积" align="center" prop="roomArea" /> <el-table-column label="使用面积" align="center" prop="roomUsearea" /> <el-table-column label="住户数" align="center" prop="occupancy" /> <el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['property:room:edit']" >修改</el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['property:room:remove']" >删除</el-button> </template> </el-table-column> </el-table> <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> <!-- 添加或修改房间对话框 --> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> <!-- ??????????????????????????????????????????????? --> <el-form-item label="选择楼宇" prop="buildingId"> <el-select v-model="form.buildingId" placeholder="选择楼宇"> <el-option v-for="item in listBuilding" :key="item.buildingId" :label="item.buildingName" :value="item.buildingId" ></el-option> </el-select> </el-form-item> <el-form-item label="选择单元" prop="unitId"> <el-select v-model="form.unitId" placeholder="选择单元"> <el-option v-for="item in listUnit" :key="item.unitId" :label="item.unitName" :value="item.unitId" ></el-option> </el-select> </el-form-item> <el-form-item label="选择楼层" prop="floorId"> <el-select v-model="form.unitId" placeholder="选择楼层"> <el-option v-for="item in listFloor" :key="item.floorId" :label="item.floorName" :value="item.floorId" ></el-option> </el-select> </el-form-item> <!-- ??????????????????????????????????????????????? --> <el-form-item label="房间号" prop="roomCode"> <el-input v-model="form.roomCode" /> </el-form-item> <el-form-item label="房间用途" prop="purpose"> <el-select v-model="form.purpose" placeholder="选择房间用途" clearable> <el-option v-for="dict in dict.type.wy_room_purpose" :key="dict.value" :label="dict.label" :value="dict.value" /> </el-select> </el-form-item> <el-form-item label="建筑面积" prop="roomArea"> <el-input v-model="form.roomArea" placeholder="" /> </el-form-item> <el-form-item label="使用面积" prop="roomUsearea"> <el-input v-model="form.roomUsearea" placeholder="" /> </el-form-item> <el-form-item label="备注" prop="remark"> <el-input v-model="form.remark" type="textarea" placeholder="" /> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="submitForm">确 定</el-button> <el-button @click="cancel">取 消</el-button> </div> </el-dialog> </div> </template> <script> import { listRoom, getRoom, delRoom, addRoom, updateRoom } from "@/api/property/room"; import { listBuilding } from "@/api/property/building"; import { listUnit } from "@/api/property/unit"; import { listFloor } from "@/api/property/floor"; export default { name: "Room", dicts: ['wy_room_purpose'], data() { return { // 遮罩层 loading: true, // 选中数组 ids: [], // 非单个禁用 single: true, // 非多个禁用 multiple: true, // 显示搜索条件 showSearch: true, // 总条数 total: 0, // 房间表格数据 roomList: [], // 弹出层标题 title: "", // 是否显示弹出层 open: false, // 查询参数 queryParams: { pageNum: 1, pageSize: 20, roomCode: null, floorId: null, purpose: null, roomArea: null, roomUsearea: null, occupancy: null, buildingName: null, unitName: null, floorName: null, }, // 表单参数 form: {}, // 表单校验 rules: { }, //楼宇数据 listBuilding: [], //单元数据 listUnit: [], //楼层数据 listFloor: [], //住户数据 }; }, created() { this.getList(); this.getBuildingList(); this.getUnitList(); this.getFloorList(); }, methods: { /** 查询房间列表 */ getList() { this.loading = true; listRoom(this.queryParams).then(response => { this.roomList = response.rows; console.log(this.roomList) this.total = response.total; this.loading = false; }); }, /** 查询楼宇数据列表 */ getBuildingList() { this.loading = true; listBuilding(this.queryParams).then(response => { console.log("Building list response:", response); this.listBuilding = response.rows; this.total = response.total; this.loading = false; }); }, /** 查询单元数据列表 */ getUnitList() { this.loading = true; listUnit(this.queryParams).then(response => { this.listUnit = response.rows; this.total = response.total; this.loading = false; }); }, /** 查询楼层数据列表 */ getFloorList() { this.loading = true; listFloor(this.queryParams).then(response => { this.listFloor = response.rows; this.total = response.total; this.loading = false; }); }, // 取消按钮 cancel() { this.open = false; this.reset(); }, // 表单重置 reset() { this.form = { roomId: null, roomCode: null, floorId: null, purpose: null, roomArea: null, roomUsearea: null, occupancy: null, createTime: null, updateTime: null, createBy: null, updateBy: null, remark: null, delFlag: null }; this.resetForm("form"); }, /** 搜索按钮操作 */ handleQuery() { this.queryParams.pageNum = 1; this.getList(); }, /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); this.handleQuery(); }, // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.roomId) this.single = selection.length!==1 this.multiple = !selection.length }, /** 新增按钮操作 */ handleAdd() { this.reset(); this.open = true; this.title = "添加房间"; }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); const roomId = row.roomId || this.ids getRoom(roomId).then(response => { console.log(response.data) this.form = response.data; this.open = true; this.title = "修改房间"; }); }, /** 提交按钮 */ submitForm() { this.$refs["form"].validate(valid => { if (valid) { if (this.form.roomId != null) { updateRoom(this.form).then(response => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); } else { addRoom(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false; this.getList(); }); } } }); }, /** 删除按钮操作 */ handleDelete(row) { const roomIds = row.roomId || this.ids; this.$modal.confirm('是否确认删除房间编号为"' + roomIds + '"的数据项?').then(function() { return delRoom(roomIds); }).then(() => { this.getList(); this.$modal.msgSuccess("删除成功"); }).catch(() => {}); }, /** 导出按钮操作 */ handleExport() { this.download('system/room/export', { ...this.queryParams }, `room_${new Date().getTime()}.xlsx`) } } }; </script> 帮我检查代码,为什么我的页面数据不回显
07-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值